Ejemplo n.º 1
0
 public void TestBaseConvertTo1(string expected, int number, int system)
 {
     Assert.Equal(expected, MathS.ToBaseN(number, system));
 }
Ejemplo n.º 2
0
 public void TestBaseConvertTo0()
 {
     Assert.Equal("101", MathS.ToBaseN(5, 2));
     Assert.Equal("F", MathS.ToBaseN(15, 16));
 }
Ejemplo n.º 3
0
 public void TestConvertTo3(string expected, string decimalInString, int system)
 {
     Assert.Equal(expected, MathS.ToBaseN(decimal.Parse(decimalInString, CultureInfo.InvariantCulture), system));
 }
 public void TestNSTo2()
 {
     Assert.IsTrue(MathS.ToBaseN(-8.125m, 2) == "-1000.001");
     Assert.IsTrue(MathS.ToBaseN(-8.125m, 8) == "-10.1");
 }
 public void TestNSTo1()
 {
     Assert.IsTrue(MathS.ToBaseN(-5, 2) == "-101");
     Assert.IsTrue(MathS.ToBaseN(-15, 16) == "-F");
 }
 public void TestNSTo0()
 {
     Assert.IsTrue(MathS.ToBaseN(5, 2) == "101");
     Assert.IsTrue(MathS.ToBaseN(15, 16) == "F");
 }