public void ClearContents_AllBlocksDeleted() { var repository = Fixture.GetInstance <IContentRepository>(); Fixture.CreateBlock <HeroBlock>(); Assert.Single(repository.GetChildren <HeroBlock>(ContentReference.GlobalBlockFolder)); var command = new ClearContents(); command.Clear(); Assert.Empty(repository.GetChildren <HeroBlock>(ContentReference.GlobalBlockFolder)); }
public void ClearContents_AllMediasDeleted() { var repository = Fixture.GetInstance <IContentRepository>(); Fixture.Upload <ImageFile>(Resources.Get("/images").PickRandom()); Assert.Single(repository.GetChildren <ImageFile>(ContentReference.GlobalBlockFolder)); var command = new ClearContents(); command.Clear(); Assert.Empty(repository.GetChildren <ImageFile>(ContentReference.GlobalBlockFolder)); }
public void ClearContents_AllPagesDeleted() { var repository = Fixture.GetInstance <IContentRepository>(); Fixture.Create <StartPage>().Create <ArticlePage>(); Assert.Single(repository.GetChildren <StartPage>(ContentReference.RootPage)); var command = new ClearContents(); command.Clear(); Assert.Empty(repository.GetChildren <StartPage>(ContentReference.RootPage)); }
public void ClearContents_AllMediasFilesDeleted() { var repository = Fixture.GetInstance <IContentRepository>(); var registry = Fixture.GetInstance <IBlobProviderRegistry>(); var provider = (FileBlobProvider)registry.GetProvider(new Uri("//default")); Fixture.Upload <ImageFile>(Resources.Get("/images").PickRandom()); Assert.Single(Directory.EnumerateDirectories(provider.Path)); var command = new ClearContents(); command.Clear(); Assert.Empty(Directory.EnumerateDirectories(provider.Path)); }