public void Adds_New_File_With_Any_Override_Parameter(bool overwrite) { var stream = CreateTestStream("tst"); Sut.AddFile("1000/test.dat", stream, overwrite); var blob = GetBlob("1000", "test.dat"); Assert.That(blob.DownloadText(), Is.EqualTo("tst")); }
public void Creates_Blob_In_New_Directory() { var stream = CreateTestStream(); Sut.AddFile("1000/test.dat", stream); var blob = GetBlob("1000", "test.dat"); Assert.That(blob.Exists()); }
public void Creates_New_Directory_At_Root_For_Last_Directory_Before_FileName() { const string path = "1000/thumbs/test.dat"; const string sub = "thumbs"; var stream = CreateTestStream(); Sut.AddFile(path, stream); Assert.That(Sut.DirectoryExists(sub)); }
public void Creates_Blob_In_Existing_Directory() { var stream1 = CreateTestStream(); var stream2 = CreateTestStream(); Sut.AddFile("1000/test1.dat", stream1); Sut.AddFile("1000/test2.dat", stream2); var blob = GetBlob("1000", "test2.dat"); Assert.That(blob.Exists()); }
public void Overwrites_File_When_Adding_Existing_File() { var stream = CreateTestStream(); Sut.AddFile("1000/test.dat", stream); stream = CreateTestStream("tst"); Sut.AddFile("1000/test.dat", stream); var blob = GetBlob("1000", "test.dat"); Assert.That(blob.DownloadText(), Is.EqualTo("tst")); }
public void Can_Be_Enumerated_With_Filter_But_Filter_Is_Ignored() { var paths = new List <string> { "1001/test1.dat", "1001/test2.txt" }; paths.ForEach(path => Sut.AddFile(path, CreateTestStream())); var files = Sut.GetFiles("1001/", "*.txt").ToList(); Assert.That(paths.SequenceEqual(files), String.Join(",", files)); }
private void CreateTestFile() { Sut.AddFile(TestPath, CreateTestStream()); }