示例#1
0
        public void Should_Return_Empty_List_Successfully()
        {
            var serviceMock = MockHistoryService();
            using (var service = new PagesApiContext(Container.BeginLifetimeScope(), null, null, serviceMock.Object))
            {
                var history = service.GetContentHistory(new GetContentHistoryRequest(Guid.NewGuid()));

                Assert.IsNotNull(history);
                Assert.AreEqual(history.Items.Count, 0);
            }
        }
示例#2
0
        public void Should_Return_Sorted_List_Successfully()
        {
            var contents = CreateFakeContents();
            var serviceMock = MockHistoryService(contents);
            using (var service = new PagesApiContext(Container.BeginLifetimeScope(), null, null, serviceMock.Object))
            {
                var history = service.GetContentHistory(new GetContentHistoryRequest(Guid.NewGuid(), order: c => c.Name, orderDescending: true));

                Assert.IsNotNull(history);
                Assert.AreEqual(history.Items.Count, 4);
                Assert.AreEqual(history.Items[1].Id, contents.First(c => c.Name == "Test_1").Id);
            }
        }