public void ReadsWithoutContent() { using (var dir = new TempDirectory()) using (var item = new FileCell(Path.Combine(dir.Value().FullName, "itemFile.tmp"))) { Assert.Empty(item.Content()); } }
public void FailsOnMissingRootPath() { Assert.Throws <ArgumentException>(() => { using (var cell = new FileCell("test.txt")) { cell.Content(); } }); }
public void FailsOnEmptyPath() { Assert.Throws <ArgumentException>(() => { using (var file = new FileCell("")) { file.Content(); } }); }
public void FailsOnMissingFilename() { Assert.Throws <ArgumentException>(() => { using (var file = new FileCell("d:/")) { file.Content(); } } ); }
public void CanUpdate() { using (var dir = new TempDirectory()) using (var item = new FileCell(Path.Combine(dir.Value().FullName, "niceFileName"))) { item.Update(new InputOf("after holiday is before holiday")); Assert.Equal( "after holiday is before holiday", new TextOf(item.Content()).AsString() ); } }