Пример #1
0
 public void ctor_string()
 {
     using (var temp = new TempDirectory())
     {
         var file = temp.Info.ToFile("example.txt").FullName;
         using (var writer = new FileWriter(file))
         {
             Assert.NotNull(writer);
         }
     }
 }
Пример #2
0
        public void op_Write_string()
        {
            using (var temp = new TempDirectory())
            {
                const string expected = "example";
                var file = temp.Info.ToFile("example.txt");
                using (var writer = new FileWriter(file))
                {
                    writer.Write(expected);
                }

                var actual = file.ReadToEnd();

                Assert.Equal(expected, actual);
            }
        }