public void Login_InvalidCredentials_FailedAuthentication() { // Arrange HttpAuthenticationServiceChannelFactory factory = new HttpAuthenticationServiceChannelFactory(); IAuthenticationService service = factory.CreateChannel(); // Act IServiceResponseWithResultData <Guid?> actual = service.Login(new ServiceRequestWithData <Guid, AuthenticationService.LoginParameters> { Data = new AuthenticationService.LoginParameters { EmailAddress = "*****@*****.**", Password = "******" } }); // Assert Assert.AreEqual(ServiceResponseStateType.FailedAuthentication, actual.State); Assert.IsNull(actual.ResultData); }
public void Login_TestCredentials_Succeeded() { // Arrange HttpAuthenticationServiceChannelFactory factory = new HttpAuthenticationServiceChannelFactory(); IAuthenticationService service = factory.CreateChannel(); // Act IServiceResponseWithResultData <Guid?> actual = service.Login(new ServiceRequestWithData <Guid, AuthenticationService.LoginParameters> { Data = new AuthenticationService.LoginParameters { EmailAddress = "*****@*****.**", Password = "******" } }); // Assert Assert.AreEqual(ServiceResponseStateType.Succeeded, actual.State); Assert.IsNotNull(actual.ResultData); Assert.IsTrue(actual.ResultData != Guid.Empty); }