public async void TestMultipleStoreDocumentTypes() { var configManager = new ServiceDbConfigManager("TestService"); var dbAccess = CreateDbAccess(configManager); var dbAccessProvider = new TestDocumentDbAccessProvider(dbAccess); var fruitStore = new FruitStore(dbAccessProvider); await dbAccess.Open(new[] { fruitStore }); var apples = new List <Apple>(); var pears = new List <Pear>(); for (int i = 0; i < 50; i++) { var gala = new Apple { Id = Guid.NewGuid(), Type = "Gala" }; var fuji = new Apple { Id = Guid.NewGuid(), Type = "Fuji" }; await fruitStore.UpsertApple(gala); await fruitStore.UpsertApple(fuji); apples.AddRange(new[] { gala, fuji }); var bartlett = new Pear { Id = Guid.NewGuid(), Colour = "Red" }; var comice = new Pear { Id = Guid.NewGuid(), Colour = "Green" }; await fruitStore.UpsertPear(bartlett); await fruitStore.UpsertPear(comice); pears.AddRange(new[] { bartlett, comice }); } var r1 = await fruitStore.GetAppleByQuery("[x].Type = 'Gala'"); Assert.Equal(50, r1.Length); Assert.True(r1.All(x => x.Type == "Gala")); var r2 = await fruitStore.GetAllApples(); Assert.Equal(100, r2.Length); var lastApple = apples.Last(); var r3 = await fruitStore.GetAppleById(lastApple.Id); Assert.Equal(lastApple.Id, r3.Id); Assert.Equal(lastApple.Type, r3.Type); var r4 = await fruitStore.GetAppleByIds(apples.Select(x => x.Id.ToString())); Assert.Equal(100, r4.Length); var r5 = await fruitStore.GetPearByQuery("[x].Colour = @colour", new[] { new DbParameter("colour", "Red") }); Assert.Equal(50, r5.Length); Assert.True(r5.All(x => x.Colour == "Red")); var r6 = await fruitStore.GetAllPears(); Assert.Equal(100, r6.Length); var lastPear = pears.Last(); var r7 = await fruitStore.GetPearById(lastPear.Id); Assert.Equal(lastPear.Id, r7.Id); Assert.Equal(lastPear.Colour, r7.Colour); }