예제 #1
0
        public void GetPublishQueueReturnsEmptyIdListIfNoItemsAdded(
            [Greedy] FakeDataProvider sut,
            CallContext context)
        {
            var result = sut.GetPublishQueue(DateTime.MinValue, DateTime.MaxValue, context);

            result.Should().BeEmpty();
        }
예제 #2
0
        public void GetPublishQueueReturnsIdListWithoutDuplicatedIDs(
            [Greedy] FakeDataProvider sut,
            ID itemId,
            string action,
            DateTime date,
            CallContext context)
        {
            sut.AddToPublishQueue(itemId, action, date, context);
            sut.AddToPublishQueue(itemId, action, date, context);
            var result = sut.GetPublishQueue(DateTime.MinValue, DateTime.MaxValue, context);

            result.ShouldBeEquivalentTo(new IDList {
                itemId
            });
        }
예제 #3
0
        public void GetPublishQueueReturnsIdListFilteredByDates(
            int daysBeforePublishingDate,
            int daysAfterPublishingDate,
            int expectedCount,
            [Greedy] FakeDataProvider sut,
            ID itemId,
            string action,
            DateTime date,
            CallContext context)
        {
            var from = date.Add(TimeSpan.FromDays(daysBeforePublishingDate));
            var to   = date.Add(TimeSpan.FromDays(daysAfterPublishingDate));

            sut.AddToPublishQueue(itemId, action, date, context);

            var result = sut.GetPublishQueue(from, to, context);

            result.Count.Should().Be(expectedCount);
        }