private void AddNewDataItem <T>(CosmosDataDocument <T> cosmosDocument, DateTime documentDate, Dictionary <DateTime, Dictionary <string, T> > data) where T : IOutputJson { logger.LogToConsole($"[Converting Cosmos Data] Found new document day with data. Day: ('{documentDate}')"); var outputData = cosmosDocument.Data.ToDictionary(fileData => fileData.GetFileLongName()); data.Add(documentDate, outputData); }
private void AddExistingDataToTheSameDay <T>(CosmosDataDocument <T> cosmosDocument, DateTime documentDate, Dictionary <DateTime, Dictionary <string, T> > data) where T : IOutputJson { foreach (var existingData in cosmosDocument.Data) { logger.LogToConsole($"[Converting Cosmos Data] Adding a new document to existing day: ('{documentDate}'))"); data[documentDate].Add(existingData.GetFileLongName(), existingData); } }
public void WhenCreateDataDocumentShouldCallCreateDocumentFromCosmosConnection() { var cosmosDocument = new CosmosDataDocument <WorkItem>(); sut.CreateDataDocument(cosmosDocument); cosmosConnectionMock.Verify(x => x.CreateDocument(cosmosContainer, cosmosDocument, null), Times.Once); }
public void CreateDataDocument <T>(CosmosDataDocument <T> document) where T : IOutputJson { cosmosConnection.CreateDocument(cosmosDbContainer, document).Wait(); }