public async Task Run_CosmosDbReturnsEmptyCollectionOfDocuments_Return404NotFound() { //arrange var docs = new List <IntermediaryServiceDocument>(); //act var actionResult = await Function4.Run(_mockHttpRequest.Object, docs, _mockLogger); //assert Assert.IsTrue(_mockLogger.GetLogs().Where(m => m.Contains(UserFriendlyMessages.DocumentNotFound)).Count() == 1); Assert.IsInstanceOfType(actionResult, typeof(NotFoundObjectResult)); StringAssert.Contains(((NotFoundObjectResult)actionResult).Value.ToString(), UserFriendlyMessages.DocumentNotFound); }
public async Task Run_DocumentFound_Return200OKSuccessWithDocument() { //arrange var documentId = Guid.NewGuid().ToString(); List <IntermediaryServiceDocument> docs = new List <IntermediaryServiceDocument>() { new IntermediaryServiceDocument() { id = documentId } }; //act var actionResult = await Function4.Run(_mockHttpRequest.Object, docs, _mockLogger); //assert Assert.IsInstanceOfType(actionResult, typeof(OkObjectResult)); Assert.IsTrue(string.Equals(documentId, ((IntermediaryServiceDocument)((OkObjectResult)actionResult).Value).id)); }