Exemplo n.º 1
0
 public void Compare_MinusTwelveToMinusElevenWithOnePercentAndMinDotFive_False()
 {
     var comparer = new NumericComparer();
     var result = comparer.Compare(-12, -11, "1% (min 0.5)");
     Assert.That(result.AreEqual, Is.False);
 }
Exemplo n.º 2
0
 public void Compare_1DecimalAnd2dot5String_False()
 {
     var comparer = new NumericComparer();
     var result = comparer.Compare(new decimal(1), "2.5", 1, SideTolerance.Both);
     Assert.That(result.AreEqual, Is.False);
 }
Exemplo n.º 3
0
 public void Compare_1DecimalAndValue_True()
 {
     var comparer = new NumericComparer();
     var result = comparer.Compare(new decimal(1), "(value)", 1, SideTolerance.Both);
     Assert.That(result.AreEqual, Is.True);
 }
Exemplo n.º 4
0
 public void Compare_TwelveToIntervalTenToFourteen_True()
 {
     var comparer = new NumericComparer();
     var result = comparer.Compare(12, "[10;14]");
     Assert.That(result.AreEqual, Is.True);
 }
Exemplo n.º 5
0
 public void Compare_TwelveToIntervalTenToTwelveOpen_False()
 {
     var comparer = new NumericComparer();
     var result = comparer.Compare("[10;12[", 12);
     Assert.That(result.AreEqual, Is.False);
 }
Exemplo n.º 6
0
 public void Compare_TwelveToIntervalNegativeInfinityToFourteen_True()
 {
     var comparer = new NumericComparer();
     var result = comparer.Compare("[-inf;14]", 12);
     Assert.That(result.AreEqual, Is.True);
 }
Exemplo n.º 7
0
 public void Compare_TwelveToIntervalPositive_True()
 {
     var comparer = new NumericComparer();
     var result = comparer.Compare("(positive)", 12);
     Assert.That(result.AreEqual, Is.True);
 }
Exemplo n.º 8
0
 public void Compare_NullAndValue_False()
 {
     var comparer = new NumericComparer();
     var result = comparer.Compare(null, "(value)", 1, SideTolerance.Both);
     Assert.That(result.AreEqual, Is.False);
 }
Exemplo n.º 9
0
 public void Compare_SevenAndFiveWithLessThanFifty_True()
 {
     var comparer = new NumericComparer();
     var result = comparer.Compare(7, 5, "-50");
     Assert.That(result.AreEqual, Is.True);
 }
Exemplo n.º 10
0
 public void Compare_NullAndAny_True()
 {
     var comparer = new NumericComparer();
     var result = comparer.Compare(null, "(any)", 1, SideTolerance.Both);
     Assert.That(result.AreEqual, Is.True);
 }
Exemplo n.º 11
0
 public void Compare_NullAndNullPlaceHolder_False()
 {
     var comparer = new NumericComparer();
     var result = comparer.Compare(null, "(null)", 1, SideTolerance.Both);
     Assert.That(result.AreEqual, Is.True);
 }
Exemplo n.º 12
0
 public void Compare_NullAnd1Decimal_False()
 {
     var comparer = new NumericComparer();
     var result = comparer.Compare(null, new decimal(1), 1, SideTolerance.Both);
     Assert.That(result.AreEqual, Is.False);
 }
Exemplo n.º 13
0
 public void Compare_NonValidPercentageForTolerance_ArgumentException()
 {
     var comparer = new NumericComparer();
     Assert.Throws<ArgumentException>(delegate { comparer.Compare(12, 11, "1,1%"); });
 }
Exemplo n.º 14
0
 public void Compare_NonNumericAndAny_FormatException()
 {
     var comparer = new NumericComparer();
     Assert.Throws<FormatException>(delegate { comparer.Compare("string", "(any)", 1, SideTolerance.Both); });
 }
Exemplo n.º 15
0
 public void Compare_1DecimalAnd1String_True()
 {
     var comparer = new NumericComparer();
     var result = comparer.Compare(new decimal(1), "1.0");
     Assert.That(result.AreEqual, Is.True);
 }
Exemplo n.º 16
0
 public void Compare_SevenAndFiveWithMoreThanFifty_False()
 {
     var comparer = new NumericComparer();
     var result = comparer.Compare(7, 5, "+50");
     Assert.That(result.AreEqual, Is.False);
 }
Exemplo n.º 17
0
 public void Compare_TwelveToIntervalLessThanEighteen_True()
 {
     var comparer = new NumericComparer();
     var result = comparer.Compare("(<18)", 12);
     Assert.That(result.AreEqual, Is.True);
 }
Exemplo n.º 18
0
 public void Compare_TwelveToElevenWithAToleranceOFTenPercent_True()
 {
     var comparer = new NumericComparer();
     var result = comparer.Compare(12, 11, "10%");
     Assert.That(result.AreEqual, Is.True);
 }
Exemplo n.º 19
0
 public void Compare_TwelveToIntervalPositiveSymbol_False()
 {
     var comparer = new NumericComparer();
     var result = comparer.Compare("(0+)", -12);
     Assert.That(result.AreEqual, Is.False);
 }
Exemplo n.º 20
0
 public void Compare_TwelveToElevenWithHundredPercentAndMaxDotFive_False()
 {
     var comparer = new NumericComparer();
     var result = comparer.Compare(12, 11, "100% (max 0.5)");
     Assert.That(result.AreEqual, Is.False);
 }
Exemplo n.º 21
0
 public void Compare_TwelveToIntervalTenHalfToFourteenHalf_True()
 {
     var comparer = new NumericComparer();
     var result = comparer.Compare("]10.5;14.5]", 12);
     Assert.That(result.AreEqual, Is.True);
 }
Exemplo n.º 22
0
 public void Compare_TwelveToElevenWithHundredPercentAndMaxTwo_True()
 {
     var comparer = new NumericComparer();
     var result = comparer.Compare(12, 11, "100% (max 2)");
     Assert.That(result.AreEqual, Is.True);
 }
Exemplo n.º 23
0
 public void Compare_TwelveToIntervalTenToTwelveClosed_True()
 {
     var comparer = new NumericComparer();
     var result = comparer.Compare("[10;12]", 12);
     Assert.That(result.AreEqual, Is.True);
 }
Exemplo n.º 24
0
 public void Compare_TwelveToElevenWithOnePercentAndMinTwo_True()
 {
     var comparer = new NumericComparer();
     var result = comparer.Compare(12, 11, "1% (min 2)");
     Assert.That(result.AreEqual, Is.True);
 }
Exemplo n.º 25
0
 public void Compare_TwelveToIntervalTwelveOpenToFourteen_False()
 {
     var comparer = new NumericComparer();
     var result = comparer.Compare("]12;14]", 12);
     Assert.That(result.AreEqual, Is.False);
 }
Exemplo n.º 26
0
 public void Compare_TwelveToElevenWithTenPercentAndMinDotFive_True()
 {
     var comparer = new NumericComparer();
     var result = comparer.Compare(12, 11, "10% (min 0.5)");
     Assert.That(result.AreEqual, Is.True);
 }
Exemplo n.º 27
0
 public void Compare_1DecimalAnd2String_False()
 {
     var comparer = new NumericComparer();
     var result = comparer.Compare(new decimal(1), "2.0");
     Assert.That(result.AreEqual, Is.False);
 }
Exemplo n.º 28
0
 public void Compare_TwelveToIntervalGreaterOrEqualToEighteen_False()
 {
     var comparer = new NumericComparer();
     var result = comparer.Compare("(>=18)", 12);
     Assert.That(result.AreEqual, Is.False);
 }
Exemplo n.º 29
0
 public void Compare_FiveAndSevenWithLessThanFiftyPercent_False()
 {
     var comparer = new NumericComparer();
     var result = comparer.Compare(5, 7, "-50%");
     Assert.That(result.AreEqual, Is.False);
 }
Exemplo n.º 30
0
 public void Compare_MinusTwelveToMinusElevenWithAToleranceOfOnePercent_False()
 {
     var comparer = new NumericComparer();
     var result = comparer.Compare(-12, -11, "1%");
     Assert.That(result.AreEqual, Is.False);
 }