public void GetStoredCredentials_returns_null_when_no_user_found(LoginCredentials credentials, UserCredentialsRepository sut) { // Act var result = sut.GetStoredCredentials(credentials); // Assert Assert.IsNull(result); }
public void GetStoredCredentials_returns_correct_identity_when_user_found(LoginCredentials credentials, User user, [Frozen, InMemory] IEntityData data, UserCredentialsRepository sut) { // Arrange user.GenerateIdentity(); user.Username = credentials.Username; data.Add(user); // Act var result = sut.GetStoredCredentials(credentials); // Assert Assert.AreEqual(user.GetIdentity(), result.UserInformation.Identity); }
public void GetStoredCredentials_returns_matching_serialized_credentials_when_user_found(LoginCredentials credentials, User user, [Frozen, InMemory] IEntityData data, UserCredentialsRepository sut) { // Arrange user.GenerateIdentity(); user.Username = credentials.Username; data.Add(user); // Act var result = sut.GetStoredCredentials(credentials); // Assert Assert.AreEqual(user.SerializedCredentials, result.SerializedCredentials); }
public void GetStoredCredentials_returns_credentials_when_user_is_found(LoginCredentials credentials, User user, [Frozen, InMemory] IEntityData data, UserCredentialsRepository sut) { // Arrange user.GenerateIdentity(); user.Username = credentials.Username; data.Add(user); // Act var result = sut.GetStoredCredentials(credentials); // Assert Assert.NotNull(result); }
public void GetStoredCredentials_throws_exception_when_credentials_are_null(UserCredentialsRepository sut) { // Act & Assert Assert.Throws <ArgumentNullException>(() => sut.GetStoredCredentials(null)); }