public void Init_DoesNotClearBlobs() { const string TestBlobContainer = "testcontainer"; const string TestTableName = "testtable"; const string TestQueueName = "testqueue"; new AzureStorageEmulatorAutomation().Start(); TestHelper.AddTestBlobToContainer(TestBlobContainer); TestHelper.AddTestRowToTable(TestTableName); TestHelper.AddTestQueueItemTo(TestQueueName); Func <bool> blobContainerContainsTestBlob = () => TestHelper.BlobContainerExistsAndContainsTestBlob(TestBlobContainer); Func <bool> tableContainsTestRow = () => TestHelper.TableExistsAndContainsTestRow(TestTableName); Func <bool> queueContainsTestMessage = () => TestHelper.QueueExistsAndContainsTestMessage(TestQueueName); Assert.True(blobContainerContainsTestBlob()); Assert.True(tableContainsTestRow()); Assert.True(queueContainsTestMessage()); _sut.Init(); _sut.Start(); Assert.True(blobContainerContainsTestBlob()); Assert.True(tableContainsTestRow()); Assert.True(queueContainsTestMessage()); _sut.ClearAll(); }
public async Task Init_DoesNotClearBlobs() { const string testBlobContainer = "testcontainer"; const string testTableName = "testtable"; const string testQueueName = "testqueue"; new AzureStorageEmulatorAutomation().Start(); await TestHelper.AddTestBlobToContainerAsync(testBlobContainer); await TestHelper.AddTestRowToTableAsync(testTableName); await TestHelper.AddTestQueueItemToAsync(testQueueName); async Task <bool> BlobContainerContainsTestBlob() => await TestHelper.BlobContainerExistsAndContainsTestBlobAsync(testBlobContainer); async Task <bool> TableContainsTestRow() => await TestHelper.TableExistsAndContainsTestRowAsync(testTableName); async Task <bool> QueueContainsTestMessage() => await TestHelper.QueueExistsAndContainsTestMessageAsync(testQueueName); Assert.True(await BlobContainerContainsTestBlob()); Assert.True(await TableContainsTestRow()); Assert.True(await QueueContainsTestMessage()); storageEm.Init(); storageEm.Start(); Assert.True(await BlobContainerContainsTestBlob()); Assert.True(await TableContainsTestRow()); Assert.True(await QueueContainsTestMessage()); storageEm.ClearAll(); }