Пример #1
0
        public async Task Should_get_beers_containers_temperatures()
        {
            var beerService = MockBeerService(Beers, BeersContainers);

            var sut = new BeersController(
                beerService.Object
                );

            var result = await sut.GetBeersContainersTemperatures();

            var actionResult = Assert.IsType <ActionResult <IEnumerable <BeerContainerDto> > >(result);

            beerService.Verify(x => x.GetContainersTemperatures(), Times.Once);

            actionResult.Value.Should().NotBeNull();
            actionResult.Value.Count().Should().Be(3);

            actionResult.Value.First().TemperatureAlert.Should().NotBeNull();
            actionResult.Value.Last().TemperatureAlert.Should().BeNull();

            actionResult.Result.Should().BeNull();
        }