public async Task ConvertAsync_WithNeitherItemCategoryNorManufacturer_ShouldConvertToReadModel() { // Arrange var local = new LocalFixture(); var service = local.CreateService(); var store = local.CreateStore(); var items = local.CreateItemsWithNeitherItemCategoryNorManufacturer(store).ToList(); var itemCategoryIds = items .Where(i => i.ItemCategoryId != null) .Select(i => i.ItemCategoryId); var manufacturerIds = items .Where(i => i.ManufacturerId != null) .Select(i => i.ManufacturerId); var itemCategoryDict = local.CreateItemCategories(itemCategoryIds); var manufacturerDict = local.CreateManufacturers(manufacturerIds); local.ItemCategoryRepositoryMock.SetupFindByAsync(itemCategoryIds, itemCategoryDict.Values); local.ManufacturerRepositoryMock.SetupFindByAsync(manufacturerIds, manufacturerDict.Values); // Act var result = await service.ConvertAsync(items, store, default); // Assert var expected = local.ToSimpleReadModels(items, store, itemCategoryDict, manufacturerDict); using (new AssertionScope()) { result.Should().BeEquivalentTo(expected); } }