Ejemplo n.º 1
0
 public void TestTranslation7()
 {
     string expected = "20";
     BinaryNumber BN1 = new BinaryNumber("100000");
     string correct = BN1.ToAnotherSystem(Bases.Hex).ToString();
     Assert.AreEqual(expected, correct, "Перевод из 2-ой в 16-ую корректен");
 }
Ejemplo n.º 2
0
 public void TestSumBin()
 {
     int expected =3;
     BinaryNumber bin1 = new BinaryNumber("10");
     BinaryNumber bin2 = new BinaryNumber("1");
     string correct=bin1.AddToCurrent(bin2).ToString();
     Assert.AreEqual(expected.ToString(),correct , "Sum 2 binars are correctly");
 }
Ejemplo n.º 3
0
 public void TestTranslation1()
 {
     int expected = 2;
     BinaryNumber bin1 = new BinaryNumber("10");
     string correct = bin1.ToAnotherSystem(Bases._Decimal).ToString();
     Assert.AreEqual(expected.ToString(), correct, "Перевод из 2-ой в 10-ую корректен");
 }
Ejemplo n.º 4
0
 public void TestSubBin()
 {
     int expected = 1;
     BinaryNumber bin1 = new BinaryNumber("10");
     BinaryNumber bin2 = new BinaryNumber("1");
     string correct = bin1.SubFromCurrent(bin2).ToString();
     Assert.AreEqual(expected.ToString(), correct, "Minus 2 binars are correctly");
 }