public async Task TestIfGetAllPageNamesReturnsEmptyCollection() { var context = PCHUBDbContextInMemoryInitializer.InitializeContext(); var categoryPagesService = new Areas.Administration.Services.AdminCategoryPagesServices(context); var result = await categoryPagesService.GetAllPageNamesAsync(); Assert.Empty(result); }
public async Task TestIfGetAllPageNamesWorksAccordingly(string pageName) { var context = PCHUBDbContextInMemoryInitializer.InitializeContext(); var categoryPagesService = new Areas.Administration.Services.AdminCategoryPagesServices(context); await context.Pages.AddAsync(new Page { PageName = pageName, }); await context.SaveChangesAsync(); var result = await categoryPagesService.GetAllPageNamesAsync(); Assert.NotEmpty(result); Assert.DoesNotContain(result, x => x == "Index"); Assert.Contains(result, x => x == pageName); }