Created
July 21, 2019 17:06
-
-
Save obegendi/6e20744bdc88348781aa0664dc9e92f2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Fact] | |
public void LinqToMocks() | |
{ | |
//Arrange | |
IValidator mockValidator | |
= Mock.Of<IValidator> | |
( | |
validator => | |
validator.IsValid(It.IsAny<string>()) == true | |
); | |
var sut = new CreditApplicationEvaluator(mockValidator); | |
var application = new CreditApplication { MonthlyIncome = 5000 }; | |
//Act | |
CreditApplicationDecision decision = sut.Evaluate(application); | |
//Assert | |
Assert.Equal(CreditApplicationDecision.AutoDeclined, decision); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment