public void SessionPersonalisationGroupCriteria_MatchesVisitor_WithDefinitionForGreaterThanNumericValue_WithNonMatchingSession_ReturnsFalse()
        {
            // Arrange
            var mockSessionProvider = MockSessionProvider();
            var criteria = new SessionPersonalisationGroupCriteria(mockSessionProvider.Object);
            var definition = string.Format(DefinitionFormat, "numericCompareTest", "GreaterThanValue", "7");

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

            // Assert
            Assert.IsFalse(result);
        }
        public void SessionPersonalisationGroupCriteria_MatchesVisitor_WithInvalidDefinition_ThrowsException()
        {
            // Arrange
            var mockSessionProvider = MockSessionProvider();
            var criteria = new SessionPersonalisationGroupCriteria(mockSessionProvider.Object);
            var definition = "invalid";

            // Act
            criteria.MatchesVisitor(definition);
        }
        public void SessionPersonalisationGroupCriteria_MatchesVisitor_WithEmptyDefinition_ThrowsException()
        {
            // Arrange
            var mockSessionProvider = MockSessionProvider();
            var criteria = new SessionPersonalisationGroupCriteria(mockSessionProvider.Object);

            // Act
            criteria.MatchesVisitor((string)null);
        }
        public void SessionPersonalisationGroupCriteria_MatchesVisitor_WithDefinitionForSessionMatchingValue_WithNonMatchingSession_ReturnsFalse()
        {
            // Arrange
            var mockSessionProvider = MockSessionProvider();
            var criteria = new SessionPersonalisationGroupCriteria(mockSessionProvider.Object);
            var definition = string.Format(DefinitionFormat, "key", "MatchesValue", "aaa,bbb,xxx");

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

            // Assert
            Assert.IsFalse(result);
        }
        public void SessionPersonalisationGroupCriteria_MatchesVisitor_WithDefinitionForSessionExists_WithMissingSession_ReturnsFalse()
        {
            // Arrange
            var mockSessionProvider = MockSessionProvider();
            var criteria = new SessionPersonalisationGroupCriteria(mockSessionProvider.Object);
            var definition = string.Format(DefinitionFormat, "missing-key", "Exists", string.Empty);

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

            // Assert
            Assert.IsFalse(result);
        }
        public void SessionPersonalisationGroupCriteria_MatchesVisitor_WithDefinitionForLessThanStringValue_WithMatchingSession_ReturnsTrue()
        {
            // Arrange
            var mockSessionProvider = MockSessionProvider();
            var criteria = new SessionPersonalisationGroupCriteria(mockSessionProvider.Object);
            var definition = string.Format(DefinitionFormat, "stringCompareTest", "LessThanValue", "ccc");

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

            // Assert
            Assert.IsTrue(result);
        }