Esempio n. 1
0
        public async Task GetByCompanyWithIncludedFields()
        {
            var log = await _dailyRepository.AddAsync(LogEventGenerator.Generate(companyId: "1234567890", message: "test"), o => o.ImmediateConsistency());

            Assert.NotNull(log?.Id);

            var results = await _dailyRepository.GetByCompanyAsync(log.CompanyId);

            Assert.Equal(1, results.Documents.Count);
            Assert.Equal(log, results.Documents.First());

            results = await _dailyRepository.GetPartialByCompanyAsync(log.CompanyId);

            Assert.Equal(1, results.Documents.Count);
            var companyLog = results.Documents.First();

            Assert.Equal(log.Id, companyLog.Id);
            Assert.Equal(log.CreatedUtc, companyLog.CreatedUtc);
            Assert.Null(companyLog.Message);
            Assert.Null(companyLog.CompanyId);
        }