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>(); }
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(); }
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(); }