コード例 #1
0
        public void HostPersonalisationGroupCriteria_MatchesVisitor_WithEmptyDefinition_ThrowsException()
        {
            // Arrange
            var mockHostProvider = MockHostProvider();
            var criteria         = new HostPersonalisationGroupCriteria(mockHostProvider.Object);

            // Act
            Assert.Throws <ArgumentNullException>(() => criteria.MatchesVisitor(null));
        }
コード例 #2
0
        public void HostPersonalisationGroupCriteria_MatchesVisitor_WithEmptyDefinition_ThrowsException()
        {
            // Arrange
            var mockHostProvider = MockHostProvider();
            var criteria         = new HostPersonalisationGroupCriteria(mockHostProvider.Object);

            // Act
            criteria.MatchesVisitor((string)null);
        }
コード例 #3
0
        public void HostPersonalisationGroupCriteria_MatchesVisitor_WithInvalidDefinition_ThrowsException()
        {
            // Arrange
            var mockHostProvider = MockHostProvider();
            var criteria         = new HostPersonalisationGroupCriteria(mockHostProvider.Object);
            var definition       = "invalid";

            // Act
            Assert.Throws <ArgumentException>(() => criteria.MatchesVisitor(definition));
        }
コード例 #4
0
        public void HostPersonalisationGroupCriteria_ContainsVisitor_WithDefinitionForHostContains_WithMatchingValue_ReturnsTrue()
        {
            // Arrange
            var mockHostProvider = MockHostProvider();
            var criteria         = new HostPersonalisationGroupCriteria(mockHostProvider.Object);
            var definition       = string.Format(DefinitionFormat, "example", "ContainsValue");

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

            // Assert
            Assert.IsTrue(result);
        }
コード例 #5
0
        public void HostPersonalisationGroupCriteria_MatchesVisitor_WithDefinitionForHostDoesNotMatch_WithMatchingValue_ReturnsFalse()
        {
            // Arrange
            var mockHostProvider = MockHostProvider();
            var criteria         = new HostPersonalisationGroupCriteria(mockHostProvider.Object);
            var definition       = string.Format(DefinitionFormat, "http://www.example.com/", "DoesNotMatchValue");

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

            // Assert
            Assert.IsFalse(result);
        }