コード例 #1
0
        public void FallsBackToStringComparison_WhenPassedInvalidXmlValues()
        {
            var comparison = new XmlComparison();

            RunComparer(comparison, "NOT XML", "NOT XML", true);
            RunComparer(comparison, "NOT XML", "ALSO NOT XML", false);
        }
コード例 #2
0
        protected override void Append(StringBuilder builder, XmlComparison difference)
        {
            builder.Append("  ").Append(difference.ComparisonType).Append(":");

            if (difference.ExpectedDetails != null)
            {
                builder.AppendLine();
                builder.Append("    Expected: ");
                this.Append(builder, difference.ExpectedDetails);
            }

            if (difference.ActualDetails != null)
            {
                builder.AppendLine();
                builder.Append("    Actual: ");
                this.Append(builder, difference.ActualDetails);
            }
        }
コード例 #3
0
        public void XmlComparison_CanCompare_XmlFieldTypes(string fieldType, bool expected)
        {
            var comparison = new XmlComparison();

            comparison.CanCompare(new FakeFieldValue("foo", fieldType), new FakeFieldValue("foo", fieldType)).Should().Be(expected);
        }
コード例 #4
0
        public void ReturnsFalse_WhenUnequalStrings(string val1, string val2)
        {
            var comparison = new XmlComparison();

            RunComparer(comparison, val1, val2, false);
        }
コード例 #5
0
        public void ReturnsTrue_WhenEqualStrings(string val1, string val2)
        {
            var comparison = new XmlComparison();

            RunComparer(comparison, val1, val2, true);
        }
コード例 #6
0
        public void Throws_WhenPassedInvalidXmlValues()
        {
            var comparison = new XmlComparison();

            Assert.Throws <InvalidOperationException>(() => RunComparer(comparison, "NOT XML", "NOT XML", false));
        }