Exemplo n.º 1
0
        public async Task GetListAsync_Should_returnProductsList()
        {
            var input  = new PagedProductRequestDto();
            var result = await _productAppService.GetListAsync(input);

            result.Items.Count.ShouldBeGreaterThanOrEqualTo(0);
            result.Items.ShouldNotBeEmpty(nameof(ProductDto.CategoryName));
            result.Items.ShouldNotBeEmpty(nameof(ProductDto.GigName));
        }
Exemplo n.º 2
0
        public async Task GetListAsync_WhenFilteredByCategory_ShouldReturnFilteredList()
        {
            var input = new PagedProductRequestDto
            {
                CategoryId = Guid.Parse(Zero1FiveTestData.CategoryId)
            };

            var result = await _productAppService.GetListAsync(input);

            result.Items.Count.ShouldBeGreaterThanOrEqualTo(1);
            result.Items.ShouldContain(x => x.CategoryId == input.CategoryId);
        }
Exemplo n.º 3
0
        public async Task GetListAsync_WhenFilteredByKeyword_ShouldReturnFilteredList()
        {
            var input = new PagedProductRequestDto
            {
                Filter = "1"
            };

            var result = await _productAppService.GetListAsync(input);

            result.Items.Count.ShouldBeGreaterThanOrEqualTo(1);
            result.Items.ShouldContain(x => x.Title.Contains(input.Filter));
        }