Exemple #1
0
            public void DoesNotInitWithStatusDataNull()
            {
                var tmStatus       = new TmStatus(0, 1, 1);
                var tmcCommonPoint = new TmNativeDefs.TCommonPoint();

                tmStatus.FromTmcCommonPoint(tmcCommonPoint);

                Assert.False(tmStatus.IsInit);
            }
Exemple #2
0
            public void SetsApsFalse(short flags)
            {
                var tmStatus       = new TmStatus(0, 1, 1);
                var tmcCommonPoint = new TmNativeDefs.TCommonPoint
                {
                    TM_Flags = 1,
                    Data     = new short[] { 0, flags }.SelectMany(BitConverter.GetBytes).ToArray()
                };

                tmStatus.FromTmcCommonPoint(tmcCommonPoint);

                Assert.False(tmStatus.IsAps);
            }
Exemple #3
0
            public void DoesNotInitWithTmFlagsInvalid()
            {
                var tmStatus       = new TmStatus(0, 1, 1);
                var tmcCommonPoint = new TmNativeDefs.TCommonPoint
                {
                    TM_Flags = 0xFFFF,
                    Data     = new byte[] { 0 },
                };

                tmStatus.FromTmcCommonPoint(tmcCommonPoint);

                Assert.False(tmStatus.IsInit);
            }
Exemple #4
0
            public void SetsCorrectValues(short status, short flags, ushort s2Flags)
            {
                var tmStatus       = new TmStatus(0, 1, 1);
                var tmcCommonPoint = new TmNativeDefs.TCommonPoint
                {
                    TM_Flags = 1,
                    tm_s2    = s2Flags,
                    Data     = new short[] { status, flags }.SelectMany(BitConverter.GetBytes).ToArray(),
                };

                tmStatus.FromTmcCommonPoint(tmcCommonPoint);

                Assert.True(tmStatus.IsInit);
                Assert.Equal(status, tmStatus.Status);
                Assert.Equal(flags, (short)tmStatus.Flags);
                Assert.Equal(s2Flags, (ushort)tmStatus.S2Flags);
            }