Ejemplo n.º 1
0
        public void WriteContentFile_writes_an_empty_file_to_disk_if_content_is_null()
        {
            ITraceFileWriter sut = new TraceFileWriter();
            var content          = new byte[] { 65, 66, 67 };

            sut.WriteContentFile("test.content.txt", null);

            Thread.Sleep(100);             // File write is async

            File.ReadAllText("test.content.txt", Encoding.ASCII).Should().BeEmpty();

            File.Delete("test.content.txt");
        }
Ejemplo n.º 2
0
        public void WriteContentFile_writes_a_file_to_disk_that_contains_the_content()
        {
            ITraceFileWriter sut = new TraceFileWriter();
            var content          = new byte[] { 65, 66, 67 };

            sut.WriteContentFile("test.content.txt", content);

            Thread.Sleep(100);             // File write is async

            File.ReadAllText("test.content.txt", Encoding.ASCII).Should().Be("ABC");

            File.Delete("test.content.txt");
        }