public void LookForwardTest() { LookHelper lookHelper = this.CreateLookHelper(); lookHelper.Look(0.5f, 0.5f); // (только чтобы сбить начальные координаты, иначе следующая команда не выполнится) lookHelper.Look(0, 0); Assert.AreEqual( "H" + MessageHelper.IntToMessageValue((this.controlSettings.HorizontalMaximumDegree - this.controlSettings.HorizontalMinimumDegree) / 2), lookHelper.HorizontalServoCommand); }
public void LookRightTest() { LookHelper lookHelper = this.CreateLookHelper(); lookHelper.Look(1f, 0); Assert.AreEqual( "H" + MessageHelper.IntToMessageValue(this.controlSettings.HorizontalMinimumDegree), lookHelper.HorizontalServoCommand); lookHelper.Look(0.5f, 0); Assert.AreEqual( "H" + MessageHelper.IntToMessageValue((this.controlSettings.HorizontalMaximumDegree - this.controlSettings.HorizontalMinimumDegree) * 1 / 4), lookHelper.HorizontalServoCommand); }