Ejemplo n.º 1
0
        public void TestCmdRecord_IgnoreDuplicateCmd()
        {
            CmdRecord aRecord = new CmdRecord()
            {
                CmdId = "TestCmd", Time = DateTime.Now, Value = ""
            };

            Assert.IsTrue(aRecord.IsNeedReSend("A"));
            Assert.IsTrue(!aRecord.IsNeedReSend(""));
        }
Ejemplo n.º 2
0
        public void TestCmdRecord_ResendDuplicateCmd()
        {
            CmdRecord aRecord = new CmdRecord()
            {
                CmdId = "TestCmd", Time = DateTime.Now, Value = ""
            };

            aRecord.Time = DateTime.Now.Subtract(new TimeSpan(0, 0, 58));
            Assert.IsTrue(!aRecord.IsNeedReSend(""));

            aRecord.Time = DateTime.Now.Subtract(new TimeSpan(0, 0, 61));
            Assert.IsTrue(aRecord.IsNeedReSend(""));

            aRecord.Update("");
            Assert.IsTrue(!aRecord.IsNeedReSend(""));
        }