aboutsummaryrefslogtreecommitdiff
path: root/Timeline.Tests/Helpers/Authentication/PrincipalHelper.cs
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2019-11-20 00:28:53 +0800
committercrupest <crupest@outlook.com>2019-11-20 00:28:53 +0800
commited8bae9cf7fd22300678d718cfee1913209f2cd0 (patch)
tree55eaf43bda897148b0fa8a65406e7289aed3832e /Timeline.Tests/Helpers/Authentication/PrincipalHelper.cs
parent0ff98dd9274485994b11d9d00f4b647a5f2d42ac (diff)
downloadtimeline-ed8bae9cf7fd22300678d718cfee1913209f2cd0.tar.gz
timeline-ed8bae9cf7fd22300678d718cfee1913209f2cd0.tar.bz2
timeline-ed8bae9cf7fd22300678d718cfee1913209f2cd0.zip
Clean and refactor tests.
Diffstat (limited to 'Timeline.Tests/Helpers/Authentication/PrincipalHelper.cs')
-rw-r--r--Timeline.Tests/Helpers/Authentication/PrincipalHelper.cs23
1 files changed, 0 insertions, 23 deletions
diff --git a/Timeline.Tests/Helpers/Authentication/PrincipalHelper.cs b/Timeline.Tests/Helpers/Authentication/PrincipalHelper.cs
deleted file mode 100644
index 214472a2..00000000
--- a/Timeline.Tests/Helpers/Authentication/PrincipalHelper.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-using System.Linq;
-using System.Security.Claims;
-using Timeline.Models;
-
-namespace Timeline.Tests.Helpers.Authentication
-{
- public static class PrincipalHelper
- {
- internal const string AuthScheme = "TESTAUTH";
-
- internal static ClaimsPrincipal Create(string username, bool administrator)
- {
- var identity = new ClaimsIdentity(AuthScheme);
- identity.AddClaim(new Claim(identity.NameClaimType, username, ClaimValueTypes.String));
- identity.AddClaims(UserRoleConvert.ToArray(administrator).Select(role => new Claim(identity.RoleClaimType, role, ClaimValueTypes.String)));
-
- var principal = new ClaimsPrincipal();
- principal.AddIdentity(identity);
-
- return principal;
- }
- }
-}