public void SetUp() { this.additionOperator = A.Fake<AdditionOperator>(); this.subtractionOperator = A.Fake<SubtractionOperator>(); SetUpFakeAdditionOperator(this.additionOperator); SetUpFakeSubtractionOperator(this.subtractionOperator); this.testee = new Calculator(this.additionOperator, this.subtractionOperator); }
public Calculator(AdditionOperator additionOperator, SubtractionOperator subtractionOperator) { this.additionOperator = additionOperator; this.subtractionOperator = subtractionOperator; }
private static void SetUpFakeSubtractionOperator(SubtractionOperator fakeOperator) { A.CallTo(() => fakeOperator.CalculateDifference(A<int>._, A<int>._)).ReturnsLazily((int a, int b) => a - b); }