コード例 #1
0
        public async Task Find_Success()
        {
            // Arrange
            var client = _factory.CreateInMemoryDbClient(async context =>
            {
                await context.Products.AddAsync(new Product());
                await context.Products.AddAsync(new Product());
                await context.SaveChangesAsync();
            });

            // Act
            var response = await client.GetAsync(BaseUrl);

            // Assert
            response.Should().Be200Ok().And
            .Satisfy <OffsetPaged <ProductDto> >(s
                                                 => s.PaginationResult.Should().HaveCount(2));
        }
コード例 #2
0
        public async Task Find_Success()
        {
            // Arrange
            var client = _factory.CreateInMemoryDbClient(async context =>
            {
                await context.AddAsync(new Category());
                await context.AddAsync(new Category());
                await context.SaveChangesAsync();
            });

            // Act
            var response = await client.GetAsync(Uri);

            // Assert
            response.Should().Be200Ok().And
            .Satisfy <ICollection <CategoryDto> >(s
                                                  => s.Should().NotBeNullOrEmpty());
        }