コード例 #1
0
        public void DumpToFileTest()
        {
            var instance = new SampleClass();

            var file = instance.DumpToFile();

            var fileContent = System.IO.File.ReadAllText(file.Path);

            Console.WriteLine($"Dumped file: {file.Path}");

            Assert.True(!string.IsNullOrWhiteSpace(fileContent));
        }
コード例 #2
0
        public void DumpToFileAsyncTest()
        {
            var list = new List <string> {
                "item1", "item2"
            };

            list.Dump();

            var instance = new SampleClass();

            instance.Dump();

            var file = instance.DumpToFileAsync("sampleClass.json").Result;

            var fileContent = System.IO.File.ReadAllText(file.Path);

            Console.WriteLine($"Dumped file async: {file.Path}");

            Assert.True(!string.IsNullOrWhiteSpace(fileContent));
        }