public async Task EditBrandAsync_ShouldEditBrandById() { var options = new DbContextOptionsBuilder <TechAndToolsDbContext>() .UseInMemoryDatabase(databaseName: "EditBrandAsync_ShouldEditBrandById") .Options; TechAndToolsDbContext context = new TechAndToolsDbContext(options); await SeedData(context); IBrandService brandService = new BrandService(context); Brand expectedData = context.Brands.First(); expectedData.Name = "New Name"; expectedData.LogoUrl = "New Logo"; expectedData.OfficialSite = "New Site"; BrandServiceModel serviceModel = expectedData.To <BrandServiceModel>(); BrandServiceModel actualData = await brandService.EditAsync(serviceModel); Assert.Equal(expectedData.Id, actualData.Id); Assert.Equal(expectedData.Name, actualData.Name); Assert.Equal(expectedData.LogoUrl, actualData.LogoUrl); Assert.Equal(expectedData.OfficialSite, actualData.OfficialSite); Assert.NotNull(actualData); Assert.NotNull(actualData.Products); }