Exemplo n.º 1
0
 public void ReadsWithoutContent()
 {
     using (var dir = new TempDirectory())
         using (var item = new FileCell(Path.Combine(dir.Value().FullName, "itemFile.tmp")))
         {
             Assert.Empty(item.Content());
         }
 }
Exemplo n.º 2
0
 public void FailsOnMissingRootPath()
 {
     Assert.Throws <ArgumentException>(() =>
     {
         using (var cell = new FileCell("test.txt"))
         {
             cell.Content();
         }
     });
 }
Exemplo n.º 3
0
 public void FailsOnEmptyPath()
 {
     Assert.Throws <ArgumentException>(() =>
     {
         using (var file = new FileCell(""))
         {
             file.Content();
         }
     });
 }
Exemplo n.º 4
0
 public void FailsOnMissingFilename()
 {
     Assert.Throws <ArgumentException>(() =>
     {
         using (var file = new FileCell("d:/"))
         {
             file.Content();
         }
     }
                                       );
 }
Exemplo n.º 5
0
 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()
                 );
         }
 }