public async Task TestIfPageExistsReturnsFalse(string pageName) { var context = PCHUBDbContextInMemoryInitializer.InitializeContext(); var adminPageService = new Areas.Administration.Services.AdminIndexPageServices(context); Assert.False(await adminPageService.PageExistsAsync(pageName)); }
public async Task TestIfPageExistsReturnsTrue(string pageName) { var context = PCHUBDbContextInMemoryInitializer.InitializeContext(); var adminPageService = new Areas.Administration.Services.AdminIndexPageServices(context); await context.Pages.AddAsync(new Page { PageName = pageName }); await context.SaveChangesAsync(); Assert.True(await adminPageService.PageExistsAsync(pageName)); }