ZeroInstall.Publish.RetrievalMethodUtilsTest.LocalApplySingleFile C# (CSharp) Method

LocalApplySingleFile() private method

private LocalApplySingleFile ( ) : void
return void
        public void LocalApplySingleFile()
        {
            using (var tempDir = new TemporaryDirectory("0install-unit-tests"))
            {
                string tempFile = Path.Combine(tempDir, "file");
                File.WriteAllText(tempFile, @"abc");

                var file = new SingleFile();
                using (var extractedDir = file.LocalApply(tempFile, new SilentTaskHandler()))
                    File.Exists(Path.Combine(extractedDir, "file")).Should().BeTrue();

                file.Destination.Should().Be("file");
                file.Size.Should().Be(3);

                File.Exists(tempFile).Should().BeTrue(because: "Local reference file should not be removed");
            }
        }
    }