public void AutheticateUser_CorrectUserIncorrectPassword_ReturnsSuccess() { using (ShimsContext.Create()) { // Act AuthenticationResult actualResult = LdapSsoDal.AutheticateUser(TEST_USERNAME, TEST_PASSWORD); // Assert actualResult.ShouldBe(AuthenticationResult.SUCCESS); } }
public void AutheticateUser_CorrectUserRenewLease_ReturnsSuccess() { using (ShimsContext.Create()) { // Act AuthenticationResult actualResult = LdapSsoDal.AutheticateUser(TEST_USERNAME, string.Empty); // Assert actualResult.ShouldBe(AuthenticationResult.SUCCESS); } }
public void AuthenticateUser_LdapSsoDalAutheticateUser_Success_ReturnsSuccess() { using (ShimsContext.Create()) { // Arrange LdapSso.DataAccess.Fakes.ShimLdapSsoDal.AutheticateUserStringString = (a, b) => { return(AuthenticationResult.SUCCESS); }; LdapSso.DataAccess.Fakes.ShimLdapSsoDal.RenewLeaseGuidStringString = (a, b, c) => { return(true); }; LdapSsoService ldapSsoService = new LdapSsoService(); // Act AuthenticationResult actualResult = ldapSsoService.AuthenticateUser(TEST_USERNAME, TEST_PASSWORD); // Assert actualResult.ShouldBe(AuthenticationResult.SUCCESS); } }
public void AuthenticateUser_LdapSsoDalAutheticateUser_UserDoesNotExistsLdapGuidNull_InvalidCredentails() { using (ShimsContext.Create()) { // Arrange LdapSso.DataAccess.Fakes.ShimLdapSsoDal.AutheticateUserStringString = (a, b) => { return(AuthenticationResult.USER_DOES_NOT_EXISTS); }; LdapSso.DataAccess.Fakes.ShimLdapSsoDal.RenewLeaseGuidStringString = (a, b, c) => { return(true); }; LdapSso.DirectoryAccess.Fakes.ShimLdapSsoDal.AutheticateUserLdapStringString = (a, b) => { return(null); }; LdapSsoService ldapSsoService = new LdapSsoService(); // Act AuthenticationResult actualResult = ldapSsoService.AuthenticateUser(TEST_USERNAME, TEST_PASSWORD); // Assert actualResult.ShouldBe(AuthenticationResult.INVALID_CREDENTIALS); } }
public void AuthenticateUser_LdapSsoDalAutheticateUser_UserDoesNotExistsLdapValidGuid_ReturnsSuccess() { using (ShimsContext.Create()) { // Arrange LdapSso.DataAccess.Fakes.ShimLdapSsoDal.AutheticateUserStringString = (a, b) => { return(AuthenticationResult.USER_DOES_NOT_EXISTS); }; LdapSso.DataAccess.Fakes.ShimLdapSsoDal.RenewLeaseGuidStringString = (a, b, c) => { return(true); }; LdapSso.DirectoryAccess.Fakes.ShimLdapSsoDal.AutheticateUserLdapStringString = (a, b) => { return(Guid.NewGuid()); }; LdapSsoService ldapSsoService = new LdapSsoService(); // Act AuthenticationResult actualResult = ldapSsoService.AuthenticateUser(TEST_USERNAME, TEST_PASSWORD); // Assert actualResult.ShouldBe(AuthenticationResult.SUCCESS); } }