public void SetsCorrectValuesWithNoClass(string name, short classId, string text0, string text1, string textB, string textM) { var tmStatus = new TmStatus(0, 1, 1); tmStatus.SetSqlPropertiesAndClassData(name, 0, -1, classId, text0, text1, textB, textM); Assert.Equal(name, tmStatus.Name); Assert.Null(tmStatus.ClassId); Assert.Equal("ОТКЛ", tmStatus.GetClassCaption(TmStatus.ClassCaption.Off)); Assert.Equal("ВКЛ", tmStatus.GetClassCaption(TmStatus.ClassCaption.On)); }
public void SetsCorrectValuesWithClass(string name, short classId, string text0, string text1, string textB, string textM) { var tmStatus = new TmStatus(0, 1, 1); tmStatus.SetSqlPropertiesAndClassData(name, 0, -1, classId, text0, text1, textB, textM); Assert.Equal(name, tmStatus.Name); Assert.Equal((byte)classId, tmStatus.ClassId); Assert.Equal(text0, tmStatus.GetClassCaption(TmStatus.ClassCaption.Off)); Assert.Equal(text1, tmStatus.GetClassCaption(TmStatus.ClassCaption.On)); Assert.Equal(textB, tmStatus.GetClassCaption(TmStatus.ClassCaption.Break)); Assert.Equal(textM, tmStatus.GetClassCaption(TmStatus.ClassCaption.Malfunction)); }
public void ReturnsCorrectCaption(bool useClassData, bool isAps, short status, TmS2Flags s2Flags, string expected) { var tmStatus = new TmStatus(0, 1, 1); if (isAps) { tmStatus.Flags = TmFlags.StatusAps; } if (useClassData) { tmStatus.SetTmcClassData("0Txt=отключен\r\n1Txt=включен\r\nBTxt=обрыв\r\nMTxt=неиспр\r\nITxt=промеж"); } var classCaptionFor = HelperGetClassCaptionFor(status, s2Flags); var result = tmStatus.GetClassCaption(classCaptionFor); Assert.Equal(expected, result); }