mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-07 08:28:30 -04:00
43 lines
1.1 KiB
C#
43 lines
1.1 KiB
C#
|
using ArducopterConfigurator.PresentationModels;
|
||
|
using NUnit.Framework;
|
||
|
|
||
|
namespace ArducopterConfiguratorTest
|
||
|
{
|
||
|
[TestFixture]
|
||
|
public class AcroModeConfigVmTest : VmTestBase<AcroModeConfigVm>
|
||
|
{
|
||
|
[SetUp]
|
||
|
public void Setup()
|
||
|
{
|
||
|
sampleLineOfData = "1.950,0.100,0.200,1.950,0.300,0.400,3.200,0.500,0.600,0.320";
|
||
|
getCommand = "P";
|
||
|
setCommand = "O";
|
||
|
|
||
|
_fakeComms = new FakeComms();
|
||
|
_vm = new AcroModeConfigVm(_fakeComms);
|
||
|
}
|
||
|
|
||
|
[Test]
|
||
|
public void UpdateStringSentIsCorrect()
|
||
|
{
|
||
|
_vm.PitchP = 1.0F;
|
||
|
_vm.PitchI = 2.0F;
|
||
|
_vm.PitchD = 3.0F;
|
||
|
_vm.RollP = 5.0F;
|
||
|
_vm.RollI = 6.0F;
|
||
|
_vm.RollD = 7.0F;
|
||
|
_vm.YawP = 8.0F;
|
||
|
_vm.YawI = 9.0F;
|
||
|
_vm.YawD = 10.0F;
|
||
|
_vm.TransmitterFactor = 4.0F;
|
||
|
|
||
|
_vm.UpdateCommand.Execute(null);
|
||
|
|
||
|
Assert.AreEqual(1, _fakeComms.SentItems.Count);
|
||
|
Assert.AreEqual("O5;6;7;1;2;3;8;9;10;4", _fakeComms.SentItems[0]);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|