public void Auth_DoNotPassUser() { UserValidation userValidation = this.CreateUserValidation(); subServiceUserRepository.CheckUser("A", "B").Returns(false); Assert.Throws <UnauthorizedAccessException>(() => userValidation.Auth("A", "B")); }
public void Auth_PassUser() { UserValidation userValidation = this.CreateUserValidation(); subServiceUserRepository.CheckUser("A", "B").Returns(true); var token = userValidation.Auth("A", "B"); Assert.IsNotEmpty(token); }
public void ValidateToken_PassUser() { UserValidation userValidation = this.CreateUserValidation(); subServiceUserRepository.CheckUser("A", "B").Returns(true); var token = userValidation.Auth("A", "B"); var res = userValidation.ValidateToken(token); Assert.IsTrue(res); }