public void LoginValidator_HasItems_All_Success() { //Arrange var manager = new LoginValidator(_log); //Act var list = manager.GetValidatorsResult(new User()).Result.ToList(); //Assert Assert.IsTrue(manager.ReturnObject != null); Assert.IsTrue(list.Any()); foreach (var result in list.Select(item => item.Invoke())) { Assert.IsTrue(result.StatusCode == StatusCode.Success); } }
public void LoginValidator_HasItems_Failed() { //Arrange var manager = new LoginValidator(_log); //Act var list = manager.GetValidatorsResult(null).Result.ToList(); var results = list.Select(item => item.Invoke()).ToList(); //Assert Assert.IsTrue(manager.ReturnObject == null); Assert.IsTrue(results.Any()); Assert.IsTrue(results.Any(x => x.StatusCode == StatusCode.Failed)); foreach (var result in results) { Assert.IsTrue(result.StatusCode == StatusCode.Failed); Assert.AreEqual(result.ErrorCode, ErrorCode.NoAuthorized); } }