ZeroInstall.Publish.FeedBuilderTest.TestTemporaryDirectory C# (CSharp) Method

TestTemporaryDirectory() private method

private TestTemporaryDirectory ( ) : void
return void
        public void TestTemporaryDirectory()
        {
            var tempDir1 = new TemporaryDirectory("0install-unit-tests");
            var tempDir2 = new TemporaryDirectory("0install-unit-tests");

            _builder.TemporaryDirectory = tempDir1;
            Directory.Exists(tempDir1).Should().BeTrue(because: "Directory should exist");

            _builder.TemporaryDirectory = tempDir2;
            Directory.Exists(tempDir1).Should().BeFalse(because: "Directory should be auto-disposed when replaced with a new one");
            Directory.Exists(tempDir2).Should().BeTrue(because: "Directory should exist");

            _builder.Dispose();
            Directory.Exists(tempDir2).Should().BeFalse(because: "Directory should be disposed together with FeedBuilder");
        }
    }