예제 #1
0
        public async Task QueryDatabasesAsync_WhenQueryingAllDatabases_ThenAllDatabasesGetReturned()
        {
            // Arrange
            await _cosmonautClient.CreateDatabaseAsync(new Database { Id = "Nick" });

            await _cosmonautClient.CreateDatabaseAsync(new Database { Id = "TheGreek" });

            // Act
            var databases = (await _cosmonautClient.QueryDatabasesAsync()).ToList();

            // Assert
            databases.Select(x => x.Id).Should().Contain("Nick");
            databases.Select(x => x.Id).Should().Contain("TheGreek");

            // Cleanup
            await _cosmonautClient.DeleteDatabaseAsync("Nick");

            await _cosmonautClient.DeleteDatabaseAsync("TheGreek");
        }
예제 #2
0
 public void Dispose()
 {
     _cosmonautClient.DeleteCollectionAsync(_databaseId, _collectionName).GetAwaiter().GetResult();
     _cosmonautClient.DeleteDatabaseAsync(_databaseId).GetAwaiter().GetResult();
 }
예제 #3
0
 public void Dispose()
 {
     _cosmonautClient.DeleteDatabaseAsync(_databaseId).GetAwaiter().GetResult();
 }