示例#1
0
        public void CheckValidFile()
        {
            // arrange 
            var fileName = "test.txt";
            var content = "test";
            File.WriteAllText(fileName, content);
            
            // act 
            var test = new TestReader();
            test.LoadFile(fileName);

            // assert
            Assert.AreEqual(content, test.Content);
        }
示例#2
0
        public void CheckValidFile2()
        {
            // arrange 
            string fileName = "test.txt";
            var content = "test";
            var fs = new MockFileSystem();
            fs.Content = content;

            // act 
            var test = new TestReader();
            test.LoadFile(fileName);

            // assert 
            Assert.AreEqual(content, test.Content);
        }
示例#3
0
        public void CheckValidFileWithMoles()
        {
            // arrange 
            var fileName = "test.txt";
            var content = "test";
            MFileSystem.ReadAllTextString = (string f) =>
                                                {
                                                    Assert.IsTrue(f == fileName);
                                                    return content;
                                                };

            // act 
            var test = new TestReader();
            test.LoadFile(fileName);

            // assert 
            Assert.AreEqual(content, test.Content);
        }