示例#1
0
        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);
        }
示例#2
0
        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();
        }
示例#3
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);
        }
示例#4
0
        public void Should_Instance_By_From()
        {
            var lexorank = LexoRank.From(LexoRankBucket.Min(), LexoDecimal.Parse("1", LexoRank.NumeralSystem));

            lexorank.Bucket.Format().ShouldBe("0");
            lexorank.Decimal.Format().ShouldBe("1");
        }
示例#5
0
 public void Should_Different_NumeralSystem_By_From()
 {
     Should.Throw <LexoException>(() =>
     {
         LexoRank.From(LexoRankBucket.Min(), LexoDecimal.Parse("1", new LexoNumeralSystem10()));
     });
 }
示例#6
0
        public void Should_Equals_Format_From_Parse()
        {
            var dec1 = LexoDecimal.From(LexoInteger.Parse("12", LexoRank.NumeralSystem));

            dec1.Format().ShouldBe("12");
        }