public void ConstructorThrowsIfFileDoesNotExist() { Assert.Throws <ArgumentException>(() => { var _ = new LocalTextFile(new FileInfo("FooBarTextFile.txt")); }); }
public void ConstructorDosNotThrowIfFileExists() { Assert.DoesNotThrow(() => { var _ = new LocalTextFile(this.readTextFile); }); }
public void ConstructorThrowsOnNullArguments() { Assert.Throws <ArgumentNullException>(() => { var _ = new LocalTextFile(null); }); }
public void ContentsOfLocalFileAreRead() { var file = new LocalTextFile(this.readTextFile); var content = file.ReadLines().Select(l => l.Content); CollectionAssert.AreEqual(this.contentsOfReadFile, content); }