Esempio n. 1
0
 /// <summary>
 /// Returns an Integer indicating the Ordering of this Node compared to another Node
 /// </summary>
 /// <param name="other">Node to test against</param>
 /// <returns></returns>
 public override int CompareTo(ILiteralNode other)
 {
     if (ReferenceEquals(this, other))
     {
         return(0);
     }
     return(ComparisonHelper.CompareLiterals(this, other));
 }
        public void NodeLiteralLanguageSpecifierCase2()
        {
            NodeFactory  factory = new NodeFactory();
            ILiteralNode lcase   = factory.CreateLiteralNode("example", "en-gb");
            ILiteralNode ucase   = factory.CreateLiteralNode("example", "en-GB");

            Assert.Equal(0, ComparisonHelper.CompareLiterals(lcase, ucase));
        }
 public void ShouldSuccesfullyCompareDoubleNodeRegardlessOfCulture()
 {
     foreach (var ci in TestedCultureInfos)
     {
         TestTools.ExecuteWithChangedCulture(ci, () =>
         {
             const double left  = 1.4d;
             const double right = 3.55d;
             Assert.Equal(-1, ComparisonHelper.CompareLiterals(left.ToLiteral(_graph), right.ToLiteral(_graph)));
         });
     }
 }