Esempio n. 1
0
        public async Task DeleteCollection_NullCollectionId_ThrowsException(string collectionId)
        {
            // Arrange
            var db = new DocumentDb(location, key, database);

            // Act
            var ex = await Record.ExceptionAsync(() => db.DeleteCollection(collectionId));

            //Assert
            ex.Should().NotBeNull();
            ex.Should().BeOfType <ArgumentNullException>();
        }
Esempio n. 2
0
        public async Task DeleteCollection_NewCollectionNameProvided_NewCollectionCreated()
        {
            // Arrange
            var db = new DocumentDb(location, key, database);
            await db.CreateCollection(NewCollectionId);

            // Act
            await db.DeleteCollection(NewCollectionId);

            // Assert
            var exists = await db.CollectionExists(NewCollectionId);

            exists.Should().BeFalse();
        }