public void CookiePersonalisationGroupCriteria_MatchesVisitor_WithDefinitionForCookieContainingValue_WithNonMatchingCookie_ReturnsFalse()
        {
            // Arrange
            var mockCookieProvider = MockCookieProvider();
            var criteria = new CookiePersonalisationGroupCriteria(mockCookieProvider.Object);
            var definition = string.Format(DefinitionFormat, "key", "ContainsValue", "xxx");

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

            // Assert
            Assert.IsFalse(result);
        }
        public void CookiePersonalisationGroupCriteria_MatchesVisitor_WithDefinitionForCookieAbsent_WithExistingCookie_ReturnsFalse()
        {
            // Arrange
            var mockCookieProvider = MockCookieProvider();
            var criteria = new CookiePersonalisationGroupCriteria(mockCookieProvider.Object);
            var definition = string.Format(DefinitionFormat, "key", "DoesNotExist", string.Empty);

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

            // Assert
            Assert.IsFalse(result);
        }
        public void CookiePersonalisationGroupCriteria_MatchesVisitor_WithInvalidDefinition_ThrowsException()
        {
            // Arrange
            var mockCookieProvider = MockCookieProvider();
            var criteria = new CookiePersonalisationGroupCriteria(mockCookieProvider.Object);
            var definition = "invalid";

            // Act
            criteria.MatchesVisitor(definition);
        }
        public void CookiePersonalisationGroupCriteria_MatchesVisitor_WithEmptyDefinition_ThrowsException()
        {
            // Arrange
            var mockCookieProvider = MockCookieProvider();
            var criteria = new CookiePersonalisationGroupCriteria(mockCookieProvider.Object);

            // Act
            criteria.MatchesVisitor((string)null);
        }
        public void CookiePersonalisationGroupCriteria_MatchesVisitor_WithDefinitionForLessThanStringValue_WithNonMatchingCookie_ReturnsFalse()
        {
            // Arrange
            var mockCookieProvider = MockCookieProvider();
            var criteria = new CookiePersonalisationGroupCriteria(mockCookieProvider.Object);
            var definition = string.Format(DefinitionFormat, "stringCompareTest", "LessThanValue", "aaa");

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

            // Assert
            Assert.IsFalse(result);
        }
        public void CookiePersonalisationGroupCriteria_MatchesVisitor_WithDefinitionForGreaterThanNumericValue_WithMatchingCookie_ReturnsTrue()
        {
            // Arrange
            var mockCookieProvider = MockCookieProvider();
            var criteria = new CookiePersonalisationGroupCriteria(mockCookieProvider.Object);
            var definition = string.Format(DefinitionFormat, "numericCompareTest", "GreaterThanValue", "3");

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

            // Assert
            Assert.IsTrue(result);
        }