コード例 #1
0
        public void Test004(string attrName)
        {
            var sut = new BooleanAttributeComparer(BooleanAttributeComparision.Loose);
            var c1  = ToAttributeComparison($@"<b {attrName}=""foo"">", attrName, $@"<b {attrName}=""bar"">", attrName);
            var c2  = ToAttributeComparison($@"<b {attrName}=""true"">", attrName, $@"<b {attrName}=""true"">", attrName);
            var c3  = ToAttributeComparison($@"<b {attrName}=""true"">", attrName, $@"<b {attrName}=""false"">", attrName);


            sut.Compare(c1, CompareResult.Different).ShouldBe(CompareResult.Same);
            sut.Compare(c2, CompareResult.Different).ShouldBe(CompareResult.Same);
            sut.Compare(c3, CompareResult.Different).ShouldBe(CompareResult.Same);
        }
コード例 #2
0
        public void Test002()
        {
            var sut        = new BooleanAttributeComparer(BooleanAttributeComparision.Strict);
            var comparison = ToAttributeComparison(@"<b class="""">", "class", @"<b class="""">", "class");

            sut.Compare(comparison, CompareResult.Different).ShouldBe(CompareResult.Different);
        }
コード例 #3
0
        public void Test001()
        {
            var sut        = new BooleanAttributeComparer(BooleanAttributeComparision.Strict);
            var comparison = ToAttributeComparison("<b foo>", "foo", "<b bar>", "bar");

            sut.Compare(comparison, CompareResult.Different).ShouldBe(CompareResult.Different);
        }
コード例 #4
0
        public void Test003(string attrName)
        {
            var sut = new BooleanAttributeComparer(BooleanAttributeComparision.Strict);
            var c1  = ToAttributeComparison($@"<b {attrName}="""">", attrName, $@"<b {attrName}=""{attrName}"">", attrName);
            var c2  = ToAttributeComparison($@"<b {attrName}=""{attrName}"">", attrName, $@"<b {attrName}="""">", attrName);
            var c3  = ToAttributeComparison($@"<b {attrName}>", attrName, $@"<b {attrName}="""">", attrName);
            var c4  = ToAttributeComparison($@"<b {attrName}>", attrName, $@"<b {attrName}=""{attrName}"">", attrName);
            var c5  = ToAttributeComparison($@"<b {attrName}="""">", attrName, $@"<b {attrName}>", attrName);
            var c6  = ToAttributeComparison($@"<b {attrName}=""{attrName}"">", attrName, $@"<b {attrName}>", attrName);

            sut.Compare(c1, CompareResult.Different).ShouldBe(CompareResult.Same);
            sut.Compare(c2, CompareResult.Different).ShouldBe(CompareResult.Same);
            sut.Compare(c3, CompareResult.Different).ShouldBe(CompareResult.Same);
            sut.Compare(c4, CompareResult.Different).ShouldBe(CompareResult.Same);
            sut.Compare(c5, CompareResult.Different).ShouldBe(CompareResult.Same);
            sut.Compare(c6, CompareResult.Different).ShouldBe(CompareResult.Same);
        }