예제 #1
0
        public void MemberTypePersonalisationGroupCriteria_MatchesVisitor_WithEmptyDefinition_ThrowsException()
        {
            // Arrange
            var mockMemberTypeProvider = MockMemberTypeProvider();
            var criteria = new MemberTypePersonalisationGroupCriteria(mockMemberTypeProvider.Object);

            // Act
            criteria.MatchesVisitor((string)null);
        }
예제 #2
0
        public void MemberTypePersonalisationGroupCriteria_MatchesVisitor_WithEmptyDefinition_ThrowsException()
        {
            // Arrange
            var mockMemberTypeProvider = MockMemberTypeProvider();
            var criteria = new MemberTypePersonalisationGroupCriteria(mockMemberTypeProvider.Object);

            // Act
            Assert.Throws <ArgumentNullException>(() => criteria.MatchesVisitor(null));
        }
예제 #3
0
        public void MemberTypePersonalisationGroupCriteria_MatchesVisitor_WithInvalidDefinition_ThrowsException()
        {
            // Arrange
            var mockMemberTypeProvider = MockMemberTypeProvider();
            var criteria   = new MemberTypePersonalisationGroupCriteria(mockMemberTypeProvider.Object);
            var definition = "invalid";

            // Act
            criteria.MatchesVisitor(definition);
        }
예제 #4
0
        public void MemberTypePersonalisationGroupCriteria_MatchesVisitor_WithDefinitionNotMatchingType_WithNonMatchingType_ReturnsTrue()
        {
            // Arrange
            var mockMemberTypeProvider = MockMemberTypeProvider("anotherType");
            var criteria   = new MemberTypePersonalisationGroupCriteria(mockMemberTypeProvider.Object);
            var definition = string.Format(DefinitionFormat, "Member", "IsNotOfType");

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

            // Assert
            Assert.IsTrue(result);
        }