コード例 #1
0
 public void ForUser_ShouldNotAllowEmptyValues()
 {
     Assert.Throws <ArgumentException>(
         () => ProfileId.ForUser("   "));
 }
コード例 #2
0
 public void ForUser_ShouldCreateWithUserId(string value)
 {
     Assert.Equal(value, ProfileId.ForUser(value));
 }
コード例 #3
0
 public void ForUser_ShouldThrow_WhenUserIdMatchesAnonymousId()
 {
     Assert.Throws <ArgumentException>(
         () => ProfileId.ForUser(ProfileId.AnonymousUserId));
 }
コード例 #4
0
 public void ForUser_ShouldThrow_WhenUserIdMatchesServiceId()
 {
     Assert.Throws <ArgumentException>(
         () => ProfileId.ForUser(ProfileId.ServiceUserId));
 }
コード例 #5
0
 /// <summary>
 /// Creates a new Profile from the User's Identity (from the access token).
 /// </summary>
 /// <param name="userId">Authenticated user's Identity.</param>
 private AuthenticatedProfile(string userId)
 {
     ProfileId = ProfileId.ForUser(userId);
     Type      = ProfileType.User;
 }