예제 #1
0
        public void WriteDataDim1Test()
        {
            byte[] dataExpected = { 5, 101, 73, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

            CommandCN_Accessor target = new CommandCN_Accessor();

            using (MemoryStream stream = new MemoryStream())
            {
                target.WriteData(stream, 1001, "1");
                CollectionAssert.AreEqual(dataExpected, stream.ToArray());
            }
        }
예제 #2
0
        public void WriteDataOffTest()
        {
            byte[] dataExpected = { 36, 224, 28, 96, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

            CommandCN_Accessor target = new CommandCN_Accessor();

            using (MemoryStream stream = new MemoryStream())
            {
                target.WriteData(stream, 1001, Command.Off);
                CollectionAssert.AreEqual(dataExpected, stream.ToArray());
            }
        }
예제 #3
0
        public void BuildTest()
        {
            byte[] dataExpected =
            {
                1,  0,  32,  1, 224,  0,  0, 0,
                2,  0,  32, 96,  96, 32, 28, 7,
                3, 37, 101, 73, 224,  0,  0, 0,
                4,  0,   0,  0,   0,  0,  0, 0,
                5,  0,   0,  0,   0,  0,  0, 0
            };

            CommandCN_Accessor target = new CommandCN_Accessor();

            byte[] data = target.Build(1001, Command.On);
            CollectionAssert.AreEqual(dataExpected, data);
        }