コード例 #1
0
        public void Test06()
        {
            UInt16 [] input          = { 65535, 32768, 0, 1, 32767 };
            byte []   expectedResult = { (byte)((SECSItemFormatCodeFunctions.GetNumberFromSECSItemFormatCode(SECSItemFormatCode.U2) << 2) | 0x02),   0, 10,
                                         255,                                                                                                        255,
                                         128,                                                                                                          0,
                                         0,                                                                                                            0,
                                         0,                                                                                                            1,
                                         127, 255 };

            U2ArraySECSItem secsItem = new U2ArraySECSItem(input, SECSItemNumLengthBytes.TWO);

            Assert.AreEqual(secsItem.ToRawSECSItem(), expectedResult);
        }
コード例 #2
0
        public void test09()
        {
            UInt16[] input = new UInt16[5];
            input[0] = 0xFFFF;
            input[1] = 0x8000;
            input[2] = 0x0000;
            input[3] = 0x0001;
            input[4] = 0x7FFF;
            byte[] expectedResult = { (byte)((SECSItemFormatCodeFunctions.getNumberFromSECSItemFormatCode(SECSItemFormatCode.U2) << 2) | 0x03),   0, 0, 10,
                                      255,                                                                                                      255,
                                      128,                                                                                                        0,
                                      0,                                                                                                          0,
                                      0,                                                                                                          1,
                                      127, 255 };

            U2ArraySECSItem secsItem = new U2ArraySECSItem(input, 3);

            Assert.IsTrue(secsItem.ToRawSECSItem().SequenceEqual(expectedResult));
        }