Ejemplo n.º 1
0
        public void ReturnsTrueWhenViewResultHasRows()
        {
            var viewResult = new ViewResult<TestDocument>();
            var viewRow = new ViewResultRow<TestDocument>();
            var viewResultRows = new List<ViewResultRow<TestDocument>> {viewRow};
            viewResult.Rows = viewResultRows.ToArray();

            Assert.That(viewResult.HasRows(), Is.True);
        }
Ejemplo n.º 2
0
        public void ShouldParseViewResultInfoRows()
        {
            IViewQueryResult viewResult;

            using (TextReader stringReader = new StringReader(TestData))
                viewResult = ViewQueryResultParser.Parse(stringReader, new ViewQuery());

            ViewResultRow secondRow = viewResult.Rows.Skip(1).First();

            Assert.Equal("c615149e5ac83b40b9ad20914d00011d", secondRow.DocumentId);
            Assert.Equal("c615149e5ac83b40b9ad20914d00011d-42".ToJsonFragment(), secondRow.Key);
            TestUtils.AssertSameJson(new { rev = "1-5af52f56d6ca7a6d600f2d9f4c2c7489" }, secondRow.Value);
            Assert.Equal(
                new {
                _id          = "c615149e5ac83b40b9ad20914d00011d",
                _rev         = "1-5af52f56d6ca7a6d600f2d9f4c2c7489",
                eventType    = "ViewerDisconnected",
                type         = "liveVideoEvent",
                viewersCount = 1
            }.ToDocument(),
                secondRow.Document);
        }