public void ValidateRegisterViewModel_InvalidCredentials_ThrowsRegistrationFailedException(string userName, string password, string email) { var dataService = A.Fake <IDataService>(); var sut = new AuthValidationService(dataService); var model = new RegisterViewModel { UserName = userName, Password = password, Email = email }; Assert.ThrowsAsync <RegistrationFailedException>(() => sut.ValidateRegisterViewModel(model)); }
public void ValidateRegisterViewModel_InvalidCredentials_ThrowsRegisterFailedException(string userName, string email, string password, string firstName, string lastName) { var authValidationService = new AuthValidationService(); var model = new RegisterViewModel { UserName = userName, Password = password, Email = email, FirstName = firstName, LastName = lastName }; Action result = () => authValidationService.ValidateRegisterViewModel(model); result.Should().Throw <RegistrationFailedException>(); }