public void Document_QueryCallsClient()
        {
            var uri = new Uri("http://localhost/");
            var doc = new DocumentClientService.Document <Test>(_documentClient, uri, null);
            var models = new[] { new Test() }.AsQueryable();

            _documentClient.CreateDocumentQuery <Test>(uri, "SEL", null).Returns(models);

            var result = doc.Query("SEL");

            Assert.AreEqual(1, result.Count);
        }
示例#2
0
        public void Document_QueryCallsClient()
        {
            var uri = UriFactory.CreateDocumentCollectionUri("DB", "DOC");
            var doc = new DocumentClientService.Document <Test>(_documentClient, "DB", "DOC");
            var models = new[] { new Test() }.AsQueryable();

            _documentClient.CreateDocumentQuery <Test>(uri, "SEL", null).Returns(models);

            var result = doc.Query("SEL");

            Assert.AreEqual(1, result.Count);
        }