public async Task Collapser_CollapsesTwoBlobs() { // Arrange using (var tc = new TestContext()) { await tc.UploadAsync("a"); await tc.UploadAsync("a"); // Act await tc.Target.CollapseAsync(tc.CollapseRequest); // Assert var blobs = await tc.ListBlobsAsync(); Assert.Contains("2015.01.02.03.04.05", blobs[0].Name); Assert.Contains("latest", blobs[1].Name); Assert.Equal("a", blobs[0].Content); Assert.Equal("a", blobs[1].Content); Assert.Equal(2, blobs.Count); } }
public async Task Collapser_CollapsesLotsOfBlobs() { // Arrange using (var tc = new TestContext()) { await tc.UploadAsync("a"); await tc.UploadAsync("a"); await tc.UploadAsync("b"); await tc.UploadAsync("b"); await tc.UploadAsync("b"); await tc.UploadAsync("a"); await tc.UploadAsync("c"); await tc.UploadAsync("c"); await tc.UploadAsync("d"); await tc.UploadAsync("d"); // Act await tc.Target.CollapseAsync(tc.CollapseRequest); // Assert var blobs = await tc.ListBlobsAsync(); Assert.Contains("2015.01.02.03.04.05", blobs[0].Name); Assert.Contains("2015.01.02.03.04.07", blobs[1].Name); Assert.Contains("2015.01.02.03.04.10", blobs[2].Name); Assert.Contains("2015.01.02.03.04.11", blobs[3].Name); Assert.Contains("2015.01.02.03.04.13", blobs[4].Name); Assert.Contains("latest", blobs[5].Name); Assert.Equal("a", blobs[0].Content); Assert.Equal("b", blobs[1].Content); Assert.Equal("a", blobs[2].Content); Assert.Equal("c", blobs[3].Content); Assert.Equal("d", blobs[4].Content); Assert.Equal("d", blobs[5].Content); Assert.Equal(6, blobs.Count); } }