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); }
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); }
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); }
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); }
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); }