コード例 #1
0
        public void Mid0150Revision1()
        {
            string identifier = "My identifier less than 100";
            string package    = "00470150001         My identifier less than 100";
            var    mid        = _midInterpreter.Parse <Mid0150>(package);

            var mid0150 = new Mid0150(identifier);

            Assert.AreEqual(typeof(Mid0150), mid.GetType());
            Assert.IsNotNull(mid.IdentifierData);
            Assert.AreEqual(mid0150.Pack(), mid.Pack());
        }
コード例 #2
0
        public void Mid0150ByteRevision1()
        {
            string identifier = "My identifier less than 100";
            string package    = "00470150001         My identifier less than 100";

            byte[] bytes = GetAsciiBytes(package);
            var    mid   = _midInterpreter.Parse <Mid0150>(bytes);

            var mid0150 = new Mid0150(identifier);

            Assert.AreEqual(typeof(Mid0150), mid.GetType());
            Assert.IsNotNull(mid.IdentifierData);
            Assert.IsTrue(mid0150.PackBytes().SequenceEqual(bytes));
        }