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 SetUpFakeAdditionOperator(AdditionOperator fakeOperator) { A.CallTo(() => fakeOperator.CalculateSum(A<int>._, A<int>._)).ReturnsLazily((int a, int b) => a + b); }