Пример #1
0
        public void Testnull()
        {
            AutherService AuthersService = new AutherService(Context, LDAPService.Object, RunningNoService.Object, EncryptionService.Object);
            TokenDTO      result         = AuthersService.Login("", "");

            Assert.AreEqual("Data is null", result.Message);
        }
Пример #2
0
        public void TestPasswordnull()
        {
            AutherService AuthersService = new AutherService(Context, LDAPService.Object, RunningNoService.Object, EncryptionService.Object);
            TokenDTO      ressult        = AuthersService.Login("Test", "");

            Assert.AreEqual("The username or password is incorrect. Please Try again", ressult.Message);
        }
Пример #3
0
        public void TestUsernamefail()
        {
            EncryptionService.Setup(e => e.HashToMD5(It.IsAny <string>())).Returns("test");
            AutherService AuthersService = new AutherService(Context, LDAPService.Object, RunningNoService.Object, EncryptionService.Object);
            TokenDTO      result         = AuthersService.Login("asd", "test");

            Assert.AreEqual("Data is null", result.Message);
        }
Пример #4
0
        public void TestPasswordfail()
        {
            EncryptionService.Setup(e => e.HashToMD5(It.IsAny <string>())).Returns("sdfsdf");
            AutherService AuthersService = new AutherService(Context, LDAPService.Object, RunningNoService.Object, EncryptionService.Object);
            TokenDTO      result         = AuthersService.Login("Test", "sdfsdf");

            Assert.AreEqual("The username or password is incorrect. Please Try again", result.Message);
        }
Пример #5
0
        public void TestSuccess()
        {
            EncryptionService.Setup(e => e.HashToMD5(It.IsAny <string>())).Returns("05a671c66aefea124cc08b76ea6d30bb");
            AutherService AuthersService = new AutherService(Context, LDAPService.Object, RunningNoService.Object, EncryptionService.Object);
            TokenDTO      result         = AuthersService.Login("Test", "test");

            Assert.AreEqual("Login Success", result.Message);
        }