Example #1
0
        public void HamTao_mang__1234()
        {
            var s = new SoLon(new int[] { -1, 2, 3, 4 });

            Assert.AreEqual("-1234", s.ToString());
            Assert.AreEqual(true, s.LasoAm);
            CollectionAssert.AreEqual(new int[] { 1, 2, 3, 4 }, s.arr);
        }
Example #2
0
        public void HamTao__123()
        {
            var s = new SoLon("-123");
            var x = s.ToString();

            Assert.AreEqual("-123", x);
            Assert.AreEqual(true, s.LasoAm);
            CollectionAssert.AreEqual(new int[] { 1, 2, 3 }, s.arr);
        }
Example #3
0
        public void HamTao_1()
        {
            var s = new SoLon("1");
            var x = s.ToString();

            Assert.AreEqual("1", x);
            Assert.AreEqual(false, s.LasoAm);
            CollectionAssert.AreEqual(new int[] { 1 }, s.arr);
        }
Example #4
0
        private void btnPlus_Click(object sender, EventArgs e)
        {
            //// Khởi tạo theo hàm khởi tạo có tham số
            //SoLon solon = new SoLon(txbInput1.Text, txbInput2.Text);

            //// Gọi phương thức tính tổng không tham số
            //txbOutput.Text = solon.TongHaiSoLon();

            // Khởi tạo theo hàm khởi tạo không tham số
            SoLon solon = new SoLon();

            // Gọi phương thức tính tổng hai tham số
            txbOutput.Text = solon.TongHaiSoLon(txbInput1.Text, txbInput2.Text);
        }
Example #5
0
        public void Mu_2_10_1024()
        {
            var s = new SoLon("2") ^ new SoLon("10");

            Assert.AreEqual(true, s.Equals(new SoLon("1024")));
        }
Example #6
0
        public void Nhan_123456__1__12346()
        {
            var s = new SoLon("-1") * new SoLon("123456");

            Assert.AreEqual(true, s.Equals(new SoLon("-123456")));
        }
Example #7
0
        public void Mu_1_2_1()
        {
            var s = new SoLon("1") ^ new SoLon("2");

            Assert.AreEqual(true, s.Equals(new SoLon("1")));
        }
Example #8
0
 public void HamTao__1_23()
 {
     var s = new SoLon("-1-23");
 }
Example #9
0
        public void Cong_123456789_123456789()
        {
            var s = new SoLon("123456789") + new SoLon(new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9 });

            Assert.AreEqual(true, s.Equals(new SoLon("246913578")));
        }
Example #10
0
        public void Mu_5_11_48828125()
        {
            var s = new SoLon("5") ^ new SoLon("11");

            Assert.AreEqual(true, s.Equals(new SoLon("48828125")));
        }
Example #11
0
        public void Cong0_0_0()
        {
            var s = new SoLon("0") + new SoLon(new int[] { 0 });

            Assert.AreEqual(true, s.Equals(new SoLon("0")));
        }
Example #12
0
        public void Tru_1234567890_1234567890()
        {
            var s = new SoLon("1234567890") - new SoLon("1234567890");

            Assert.AreEqual("0", s.ToString());
        }
Example #13
0
        public void Tru_6_9__3()
        {
            var s = new SoLon("6") - new SoLon("9");

            Assert.AreEqual(true, s.Equals(new SoLon("-3")));
        }
Example #14
0
        public void Tru_0_0_0()
        {
            var s = new SoLon("") - new SoLon("0");

            Assert.AreEqual(true, s.Equals(new SoLon("")));
        }
Example #15
0
        public void Tru_0_123456__123456()
        {
            var s = new SoLon("") - new SoLon("123456");

            Assert.AreEqual(true, s.Equals(new SoLon("-123456")));
        }
Example #16
0
        public void Cong_1_9_10()
        {
            var s = new SoLon("1") + new SoLon("9");

            Assert.AreEqual(true, s.Equals(new SoLon("10")));
        }
Example #17
0
        public void Cong__123456789__123456789()
        {
            var s = new SoLon("-123456789") + new SoLon("-123456789");

            Assert.AreEqual(true, s.Equals(new SoLon("-246913578")));
        }
Example #18
0
        public void Cong_123456789__123456789()
        {
            var s = new SoLon("123456789") + new SoLon("-123456789");

            Assert.AreEqual("0", s.ToString());
        }
Example #19
0
        public void Mu_3_10_59049()
        {
            var s = new SoLon("3") ^ new SoLon("10");

            Assert.AreEqual(true, s.Equals(new SoLon("59049")));
        }
Example #20
0
        public void Tru_1234_1235__1()
        {
            var s = new SoLon("1234") - new SoLon("1235");

            Assert.AreEqual(true, s.Equals(new SoLon("-1")));
        }
Example #21
0
        public void Mu_4_10_1048576()
        {
            var s = new SoLon("4") ^ new SoLon("10");

            Assert.AreEqual(true, s.Equals(new SoLon("1048576")));
        }
Example #22
0
        public void HamSoSanh_false()
        {
            var s = new SoLon("123");

            Assert.AreEqual(false, s.Equals(new SoLon(new int[] { 1, 3, 2 })));
        }
Example #23
0
        public void Mu_6_12_2176782336()
        {
            var s = new SoLon("6") ^ new SoLon("12");

            Assert.AreEqual(true, s.Equals(new SoLon("2176782336")));
        }
Example #24
0
        public void HamSaoSanh__false()
        {
            var s = new SoLon("-1234");

            Assert.AreEqual(false, s.Equals(new SoLon("1234")));
        }
Example #25
0
        public void HamSoSanh__true()
        {
            var s = new SoLon(new int[] { -1, 2, 3, 4 });

            Assert.AreEqual(true, s.Equals(new SoLon("-1234")));
        }
Example #26
0
        public void Nhan_123_123_15129()
        {
            var s = new SoLon("123") * new SoLon("123");

            Assert.AreEqual(true, s.Equals(new SoLon("15129")));
        }
Example #27
0
        public void Tru_1_10__9()
        {
            var s = new SoLon("1") - new SoLon("10");

            Assert.AreEqual(true, s.Equals(new SoLon("-9")));
        }
Example #28
0
        public void Cong_null_123456789_0_123456789()
        {
            var s = new SoLon("") + new SoLon("123456789");

            Assert.AreEqual(true, s.Equals(new SoLon("123456789")));
        }
Example #29
0
        public void Nhan_1_0_0()
        {
            var s = new SoLon("0") * new SoLon("1");

            Assert.AreEqual(true, s.Equals(new SoLon("0")));
        }
Example #30
0
 public void TestMethod1()
 {
     var s   = new SoLon("00000000000000111111");
     var ss  = new SoLon(new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 });
     var sss = s.Cong(ss);
 }