public async void GetByIdsWitMissingIds()
        {
            var docs1 = await StoreDocument(3);

            var docs2 = await StoreDocument(4);

            var missing1    = new TestDocument();
            var missing2    = new TestDocument();
            var missingDocs = new[] { missing1, missing2 };

            var result = await _store.GetByIds(docs1.Concat(docs2).Concat(missingDocs).Select(d => d.Id));

            Assert.NotNull(result);
            Assert.Equal(2, result.Loaded.Count);
            Assert.Equal(2, result.Missing.Count);
            Assert.Empty(result.Failed);

            Assert.NotNull(result.Missing.SingleOrDefault(id => id == missing1.Id.ToString()));
            Assert.NotNull(result.Missing.SingleOrDefault(id => id == missing2.Id.ToString()));
        }
 private async Task DeleteDocument(TestDocument document)
 {
     await _store.Delete(document.Id);
 }
Esempio n. 3
0
 public async Task Upsert(TestDocument doc)
 {
     await StoreClient.UpsertDocumentAsync(doc, _mapping, new OperationOptions());
 }