예제 #1
0
        public async Task BrandsController_GetAll_Success()
        {
            var brands = new List <BrandCreateRequest> {
                new BrandCreateRequest {
                    Name = "Test brand1"
                },
                new BrandCreateRequest {
                    Name = "Test brand2"
                }
            };

            var controller = new BrandsController(_fixture.BrandService);

            foreach (var brand in brands)
            {
                await controller.Post(brand);
            }

            var result = await controller.GetAll();

            var brandVms = GetCollectionResponse <BrandVm>(result);

            Assert.NotNull(brandVms);
            foreach (var brand in brands)
            {
                Assert.Contains(brandVms, x => x.Name == brand.Name);
            }
        }
예제 #2
0
 public void _LoadBrand()
 {
     DataGrid1.DataSource = BrandsController.GetAll();
     DataGrid1.DataBind();
 }