コード例 #1
0
        public void AutheticateUser_CorrectUserIncorrectPassword_ReturnsSuccess()
        {
            using (ShimsContext.Create())
            {
                // Act
                AuthenticationResult actualResult = LdapSsoDal.AutheticateUser(TEST_USERNAME, TEST_PASSWORD);

                // Assert
                actualResult.ShouldBe(AuthenticationResult.SUCCESS);
            }
        }
コード例 #2
0
        public void AutheticateUser_CorrectUserRenewLease_ReturnsSuccess()
        {
            using (ShimsContext.Create())
            {
                // Act
                AuthenticationResult actualResult = LdapSsoDal.AutheticateUser(TEST_USERNAME, string.Empty);

                // Assert
                actualResult.ShouldBe(AuthenticationResult.SUCCESS);
            }
        }
コード例 #3
0
        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);
            }
        }
コード例 #4
0
        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);
            }
        }
コード例 #5
0
        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);
            }
        }