예제 #1
0
        public void Should_FailEqualityForDifferentMessageTypes()
        {
            var deselectReq = new DeselectReq(1, 2);
            var deselectRsp = new DeselectRsp(1, 2, 1);

            Assert.IsFalse(deselectReq.Equals(deselectRsp));
        }
예제 #2
0
        public void Should_FailEqualityForDifferentMessageTypes()
        {
            var deselectRsp = new DeselectRsp(1, 2, 3);
            var linkTestRsp = new LinkTestRsp(1);

            Assert.IsFalse(deselectRsp.Equals(linkTestRsp));
        }
예제 #3
0
        public void Should_FailEqualityForDifferentDevice()
        {
            var deselectRsp  = new DeselectRsp(2, 1, 3);
            var deselectRsp2 = new DeselectRsp(1, 1, 3);

            Assert.IsFalse(deselectRsp.Equals(deselectRsp2));
        }
예제 #4
0
        public void Should_BeEqualIfDeselectRspsEqual()
        {
            var deselectRsp  = new DeselectRsp(1, 2, 3);
            var deselectRsp2 = new DeselectRsp(1, 2, 3);

            Assert.IsTrue(deselectRsp.Equals(deselectRsp2));
        }
예제 #5
0
        public void Should_FailEqualityForDifferetObjectTypes()
        {
            var deselectRsp = new DeselectRsp(1, 2, 3);
            var obj         = "test";

            Assert.IsFalse(deselectRsp.Equals(obj));
        }
예제 #6
0
        public void Should_FailEqualityForDifferentStatus()
        {
            var deselectRsp  = new DeselectRsp(1, 2, 3);
            var deselectRsp2 = new DeselectRsp(1, 2, 4);

            Assert.IsFalse(deselectRsp.Equals(deselectRsp2));
        }
예제 #7
0
        public void Should_CreateCorrectDeselectRsp()
        {
            var deselectRsp = new DeselectRsp(1, 2, 3);

            Assert.IsTrue(deselectRsp.Type == MessageType.DeselectRsp);
            Assert.IsTrue(deselectRsp.Device == 1);
            Assert.IsTrue(deselectRsp.Context == 2);
            Assert.IsTrue(deselectRsp.Status == 3);
        }
예제 #8
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="deselectRsp"></param>
 protected void HandleDeselectRsp(DeselectRsp m)
 {
     if (_state == State.ConnectedSelected)
     {
         if (m.Status == 0)
         {
             _state = State.ConnectedNotSelected;
         }
     }
 }
예제 #9
0
        public void Should_FailEqualityForNull()
        {
            var deselectRsp = new DeselectRsp(1, 2, 3);

            Assert.IsFalse(deselectRsp.Equals(null));
        }
예제 #10
0
        public void Should_SetIsReplyRequiredToFalse()
        {
            var deselectRsp = new DeselectRsp(1, 2, 3);

            Assert.IsTrue(!deselectRsp.IsReplyRequired);
        }
예제 #11
0
        public void Should_SetIsPrimaryToFalse()
        {
            var deselectRsp = new DeselectRsp(1, 2, 3);

            Assert.IsTrue(!deselectRsp.IsPrimary);
        }