示例#1
0
        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);
        }
示例#2
0
 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);
        }
示例#4
0
 public void CreateDataDocument <T>(CosmosDataDocument <T> document) where T : IOutputJson
 {
     cosmosConnection.CreateDocument(cosmosDbContainer, document).Wait();
 }