Пример #1
0
        public async Task GivenThatIDestroyAFeedItIsNowEmpty()
        {
            using (var target = new TestFolder())
                using (var cache = new LocalCache())
                    using (var cache2 = new LocalCache())
                    {
                        var log         = new TestLogger();
                        var fileSystem  = new PhysicalFileSystem(cache, UriUtility.CreateUri(target.Root));
                        var fileSystem2 = new PhysicalFileSystem(cache2, UriUtility.CreateUri(target.Root));

                        var a = fileSystem.Get("a.txt");
                        await a.Write(new JObject(), log, CancellationToken.None);

                        await fileSystem.Commit(log, CancellationToken.None);

                        File.Exists(a.RootPath.LocalPath).Should().BeTrue("the file was not deleted yet");

                        await fileSystem2.Destroy(log, CancellationToken.None);

                        await fileSystem2.Commit(log, CancellationToken.None);

                        Directory.Exists(target).Should().BeFalse("all files were deleted");
                    }
        }