public void MissingFileException() { Mock <IInputterDialogue <string> > inputterDialogue = new Mock <IInputterDialogue <string> >(); inputterDialogue.Setup(x => x.Dialogue()).Returns(@".\NonExistantFile.txt"); FileInputter fileInputterSUT = new FileInputter(inputterDialogue.Object); Assert.Throws(typeof(MissingFileException), () => fileInputterSUT.Get()); }
public void OpenAndReadFileTest() { Mock <IInputterDialogue <string> > inputterDialogue = new Mock <IInputterDialogue <string> >(); inputterDialogue.Setup(x => x.Dialogue()).Returns(@".\InputTest1.txt"); FileInputter fileInputterSUT = new FileInputter(inputterDialogue.Object); Assert.AreEqual("testing 123 testing", fileInputterSUT.Get()); }