public async Task GetDeletableSubCategories_WithNoSubCategories_ShouldReturnAnEmptyCollection() { string onCountDiferenceErrorMessage = "The method did not return an empty collection."; var context = ApplicationDbContextInMemoryFactory.InitializeContext(); var subCategoryService = new SubCategoryService(context); var methodResult = await subCategoryService.GetDeletableSubCategories(); var expectedCount = 0; AssertExtensions.EqualCountWithMessage(expectedCount, methodResult.Count(), onCountDiferenceErrorMessage); }
public async Task GetDeletableSubCategories_WithDeletableSubCategories_ShouldReturnCorrectCollection() { string onCountDiferenceErrorMessage = "The method did not return the expected collection with elements."; var context = ApplicationDbContextInMemoryFactory.InitializeContext(); var subCategoryService = new SubCategoryService(context); await this.SeedAndGetSubCategoriesWithCategories(context); var methodResult = await subCategoryService.GetDeletableSubCategories(); var expectedCount = 6; AssertExtensions.EqualCountWithMessage(expectedCount, methodResult.Count(), onCountDiferenceErrorMessage); }