public void Should_NonEquals_From_String() { var dec1 = LexoDecimal.From(LexoInteger.Parse("12", LexoRank.NumeralSystem)); var dec2 = LexoDecimal.From(LexoInteger.Parse("120", LexoRank.NumeralSystem)); dec1.Equals(dec2).ShouldBeFalse(); }
public void Should_CompareTo_Equals() { var dec1 = LexoDecimal.From(LexoInteger.Parse("12", LexoRank.NumeralSystem)); var dec2 = LexoDecimal.From(LexoInteger.Parse("12", LexoRank.NumeralSystem)); dec1.CompareTo(dec2).ShouldBe(0); }
public void Should_CompareTo_Greater() { var dec1 = LexoDecimal.From(LexoInteger.Parse("0", LexoRank.NumeralSystem)); var dec2 = LexoDecimal.From(LexoInteger.Parse("1", LexoRank.NumeralSystem)); dec2.CompareTo(dec1).ShouldBe(1); }
public void Should_CompareTo_Equals() { var int1 = LexoInteger.Parse("12", LexoRank.NumeralSystem); var int2 = LexoInteger.Parse("12", LexoRank.NumeralSystem); int1.CompareTo(int2).ShouldBe(0); }
public void Should_NonEquals_From_String() { var int1 = LexoInteger.Parse("12", LexoRank.NumeralSystem); var int2 = LexoInteger.Parse("120", LexoRank.NumeralSystem); int1.Equals(int2).ShouldBeFalse(); }
public void Should_CompareTo_Less() { var int1 = LexoInteger.Parse("0", LexoRank.NumeralSystem); var int2 = LexoInteger.Parse("1", LexoRank.NumeralSystem); int1.CompareTo(int2).ShouldBe(-1); }
public void Should_CompareTo_Greater() { var int1 = LexoInteger.Parse("0", LexoRank.NumeralSystem); var int2 = LexoInteger.Parse("1", LexoRank.NumeralSystem); int2.CompareTo(int1).ShouldBe(1); }
public static LexoRankBucket From(string str) { var val = LexoInteger.Parse(str, LexoRank.NumeralSystem); var var2 = Values; var var3 = var2.Length; for (var var4 = 0; var4 < var3; ++var4) { var bucket = var2[var4]; if (bucket._value.Equals(val)) { return(bucket); } } throw new LexoException("Unknown bucket: " + str); }
public void Should_Equals_Format_From_Parse() { var dec1 = LexoDecimal.From(LexoInteger.Parse("12", LexoRank.NumeralSystem)); dec1.Format().ShouldBe("12"); }
private LexoRankBucket(string val) { _value = LexoInteger.Parse(val, LexoRank.NumeralSystem); }
public void Should_Equals_Format_From_Parse() { var int1 = LexoInteger.Parse("12", LexoRank.NumeralSystem); int1.Format().ShouldBe("12"); }