public void MonthOfYearPersonalisationGroupCriteria_MatchesVisitor_WithEmptyDefinition_ThrowsException()
        {
            // Arrange
            var mockDateTimeProvider = MockDateTimeProvider();
            var criteria             = new MonthOfYearPersonalisationGroupCriteria(mockDateTimeProvider.Object);

            // Act
            criteria.MatchesVisitor((string)null);
        }
Пример #2
0
        public void MonthOfYearPersonalisationGroupCriteria_MatchesVisitor_WithEmptyDefinition_ThrowsException()
        {
            // Arrange
            var mockDateTimeProvider = MockDateTimeProvider();
            var criteria             = new MonthOfYearPersonalisationGroupCriteria(mockDateTimeProvider.Object);

            // Act
            Assert.Throws <ArgumentNullException>(() => criteria.MatchesVisitor(null));
        }
        public void MonthOfYearPersonalisationGroupCriteria_MatchesVisitor_WithInvalidDefinition_ThrowsException()
        {
            // Arrange
            var mockDateTimeProvider = MockDateTimeProvider();
            var criteria             = new MonthOfYearPersonalisationGroupCriteria(mockDateTimeProvider.Object);
            var definition           = "invalid";

            // Act
            criteria.MatchesVisitor(definition);
        }
        public void MonthOfYearPersonalisationGroupCriteria_MatchesVisitor_WithValidDefinitionWithMatchingDays_ReturnsTrue()
        {
            // Arrange
            var mockDateTimeProvider = MockDateTimeProvider();
            var criteria             = new MonthOfYearPersonalisationGroupCriteria(mockDateTimeProvider.Object);
            var definition           = string.Format(DefinitionFormat, 6, 7); // June, July

            // Act
            var result = criteria.MatchesVisitor(definition);

            // Assert
            Assert.IsTrue(result);
        }
        public void MonthOfYearPersonalisationGroupCriteria_MatchesVisitor_WithValidDefinitionWithDifferentDays_ReturnsFalse()
        {
            // Arrange
            var mockDateTimeProvider = MockDateTimeProvider();
            var criteria             = new MonthOfYearPersonalisationGroupCriteria(mockDateTimeProvider.Object);
            var definition           = string.Format(DefinitionFormat, 2, 3); // February, March

            // Act
            var result = criteria.MatchesVisitor(definition);

            // Assert
            Assert.IsFalse(result);
        }
        public void MonthOfYearPersonalisationGroupCriteria_MatchesVisitor_WithValidDefinitionWithEmptyDays_ReturnsFalse()
        {
            // Arrange
            var mockDateTimeProvider = MockDateTimeProvider();
            var criteria             = new MonthOfYearPersonalisationGroupCriteria(mockDateTimeProvider.Object);
            var definition           = "[]";

            // Act
            var result = criteria.MatchesVisitor(definition);

            // Assert
            Assert.IsFalse(result);
        }