public void DoesNotInitWithStatusDataNull() { var tmStatus = new TmStatus(0, 1, 1); var tmcCommonPoint = new TmNativeDefs.TCommonPoint(); tmStatus.FromTmcCommonPoint(tmcCommonPoint); Assert.False(tmStatus.IsInit); }
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); }
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); }
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); }