Beispiel #1
0
        public void When_Using_DI_Expect_135()
        {
            // arrange
            var input = new TestInput
            {
                a = 10,
                b = 25
            };
            var myRepository  = new MathOperations();
            var addTask       = new AddStep();
            var addWithDiTask = new AddStepWithRepository(myRepository);

            var presenter = new PropertyPresenter <TestResult, ErrorOutput>();

            var sut = new AddTwoNumbersUsingDiInjectedRepository(addTask, addWithDiTask);

            // act
            sut.Execute(input, presenter);
            // assert
            var expected = new TestResult
            {
                Result = 135
            };

            presenter.SuccessContent.Should().BeEquivalentTo(expected);
        }
Beispiel #2
0
 public AddTwoNumbersUsingDiInjectedRepository(AddStep addTask, AddStepWithRepository addWithDiTask)
 {
     _addTask       = addTask;
     _addWithDiTask = addWithDiTask;
 }