예제 #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 CheckValidFileWithMoles()
        {
            // arrange
            var fileName = "test.txt";
            var content  = "test";

            MFileSystem.ReadAllTextString = delegate(string f)
            {
                Assert.IsTrue(f == fileName);
                return(content);
            };
            // act
            var test = new TestReader();

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