public void IsDocumentInCollection_DocumentDoesNotExist_ReturnsFalse() { // Arrange var db = new DocumentDb(location, key, database); var documentId = Guid.NewGuid().ToString(); // Act var exists = db.DocumentExists(CollectionId, documentId); // Assert exists.Should().BeFalse(); }
public void IsDocumentInCollection_DocumentIdIsNull_ThrowsException(string documentId) { // Arrange var db = new DocumentDb(location, key, database); // Act var ex = Record.Exception(() => db.DocumentExists(CollectionId, documentId)); //Assert ex.Should().NotBeNull(); ex.Should().BeOfType <ArgumentNullException>(); }
public async Task IsDocumentInCollection_DocumentDoesExist_ReturnsTrue() { // Arrange var db = new DocumentDb(location, key, database); var documentId = Guid.NewGuid().ToString(); var person = new PersonTest { PersonId = Guid.NewGuid(), Name = "Barney Rubble", Age = 87 }; var personEnvelope = new DocumentBase <PersonTest> { VM = person }; await db.UpsertDocument(CollectionId, documentId, personEnvelope); // Act var exists = db.DocumentExists(CollectionId, documentId); // Assert exists.Should().BeTrue(); }