public void TryConvert1Test() { PolishingStatusFromStreamConverter target = new PolishingStatusFromStreamConverter(); PolishingShortStatus result = target.TryConvert("000100000001000100050003"); Assert.AreEqual<PolisherState>(PolisherState.AutoProcess, result.Status[0].State); Assert.AreEqual<PolisherState>(PolisherState.Pause, result.Status[1].State); Assert.AreEqual<PolisherState>(PolisherState.AutoLoad, result.Status[2].State); Assert.AreEqual<bool>(true, result.Status[0].HighPressure); Assert.AreEqual<bool>(false, result.Status[1].HighPressure); Assert.AreEqual<bool>(true, result.Status[2].HighPressure); }
public void TryConvert2Test() { PolishingStatusFromStreamConverter target = new PolishingStatusFromStreamConverter(); PolishingShortStatus result = target.TryConvert("000000010001000700020006"); Assert.AreEqual<PolisherState>(PolisherState.EmergencyStop, result.Status[0].State); Assert.AreEqual<PolisherState>(PolisherState.AutoWait, result.Status[1].State); Assert.AreEqual<PolisherState>(PolisherState.Alarm, result.Status[2].State); Assert.AreEqual<bool>(false, result.Status[0].HighPressure); Assert.AreEqual<bool>(true, result.Status[1].HighPressure); Assert.AreEqual<bool>(true, result.Status[2].HighPressure); }