コード例 #1
0
        public async void WhenLowestTrolleyTotalAvailableThenPostAsyncReturnOk()
        {
            var trolley     = _fixture.Create <Trolley>();
            var lowestTotal = _fixture.Create <decimal>();

            _trolleyService
            .Setup(x => x.FindLowestTrolleyTotalAsync(trolley))
            .ReturnsAsync(lowestTotal);

            _trolleyService
            .Setup(x => x.CalculateLowestTrolleyTotalExpert(trolley))
            .Returns(lowestTotal);

            var actual = await _target.PostAsync(trolley);

            (actual.Result as StatusCodeResult)?
            .StatusCode.Should()
            .Be((int)HttpStatusCode.OK);
        }