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); }
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); }
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); }