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

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

            //Assert
            ex.Should().NotBeNull();
            ex.Should().BeOfType <ArgumentNullException>();
        }
Ejemplo n.º 2
0
        public DocumentDbTest()
        {
            location = ConfigurationManager.AppSettings["DocumentDbUrl"];
            key      = ConfigurationManager.AppSettings["DocumentDbAuthKey"];
            database = ConfigurationManager.AppSettings["DocumentDbDatabaseId"];

            var db = new DocumentDb(location, key, database);

            db.ClearCollection(NewCollectionId).Wait();
            db.ClearCollection(CollectionId).Wait();
            db.CreateCollection(CollectionId).Wait();
        }
Ejemplo n.º 3
0
        public async Task CreateCollection_NewCollectionNameProvided_NewCollectionCreated()
        {
            // Arrange
            var db = new DocumentDb(location, key, database);

            // Act
            await db.CreateCollection(NewCollectionId);

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

            exists.Should().BeTrue();
        }