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); } }
public void _LoadBrand() { DataGrid1.DataSource = BrandsController.GetAll(); DataGrid1.DataBind(); }