예제 #1
0
        public void read_contents()
        {
            TextFile.FileSystem.WriteStringToFile("foo.txt", "a bunch of text");

            var file = new TextFile("foo.txt", "anything");
            file.ReadAll().ShouldEqual("a bunch of text");
        }
예제 #2
0
        public void read_lines()
        {
            TextFile.FileSystem.WriteStringToFile("bar.txt", @"
            a
            b
            c
            d
            e
            f
            ".Trim());

            var file = new TextFile("bar.txt", "anything");
            file.ReadLines().ShouldHaveTheSameElementsAs("a", "b", "c", "d", "e", "f");
        }