コード例 #1
0
        public async Task ByIdShouldReturnItemWithThatId()
        {
            // Arrange
            //Mapper.Initialize(config => config.AddProfile<AutoMapperProfile>());
            var db = this.Context;

            this.PopulateData(db);

            var advertisementsService = new AdvertisementService(db);
            var advertisementId       = 1;

            // Act
            var result = await advertisementsService.ById(advertisementId);

            // Assert
            result
            .Name
            .Should()
            .Be("very good one");

            result
            .Description
            .Should()
            .Be("need to be in that site");

            result
            .Price
            .Should()
            .Be(300);
        }