Esempio n. 1
0
 public void AddToPublishQueueSameItemIdMultipleTimesReturnsTrue(
     [Greedy] FakeDataProvider sut,
     ID itemId,
     string action,
     DateTime date,
     CallContext context)
 {
     sut.AddToPublishQueue(itemId, action, date, context).Should().BeTrue();
     sut.AddToPublishQueue(itemId, action, date, context).Should().BeTrue();
     sut.AddToPublishQueue(itemId, action, date, context).Should().BeTrue();
 }
Esempio n. 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
            });
        }
Esempio n. 3
0
 public void AddToPublishQueueWithLanguageReturnsTrue(
     [Greedy] FakeDataProvider sut,
     ID itemId,
     string action,
     DateTime date,
     string language,
     CallContext context)
 {
     sut.AddToPublishQueue(itemId, action, date, language, context).Should().BeTrue();
 }
Esempio n. 4
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);
        }