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