Exemplo n.º 1
0
        public void FrameTestCheckSum5()
        {
            // 10(dec) = 1010 (bin)
            Frame nfra = new Frame.Builder().SetFrame(lst1).SetControlType(new CheckSumControl(), 5).Create();

            Assert.AreEqual(Convert.ToInt32(Functions.GetPartInDec(nfra.GetControlPart().GetList())), 10);
        }
Exemplo n.º 2
0
        public void SetFrameCRC2()
        {
            // 10(dec) = 1010 (bin)
            Frame nfra1 = new Frame.Builder().SetFrame(lst1).SetControlType(new CRCControl()).Create();

            //nfra1.ShowControlPart();

            Assert.AreEqual(nfra1.GetControlPart().GetCount(), 4);
        }
Exemplo n.º 3
0
        public void FrameTestCheckSum2()
        {
            Frame nfra = new Frame.Builder().SetFrame(lst2).SetControlType(new CheckSumControl()).Create();

            Assert.AreEqual(Convert.ToInt32(Functions.GetPartInDec(nfra.GetControlPart().GetList())), 4);
        }
Exemplo n.º 4
0
        public void FrameTestCheckSum1()
        {
            Frame nfra = new Frame.Builder().SetFrame(lst0).SetControlType(new CheckSumControl()).Create();

            Assert.AreEqual(nfra.GetControlPart().GetList().Sum(x => Convert.ToInt32(x)), 0);
        }