ardupilot/Configurator/Configurator.Net/Test/AcroModeConfigVmTest.cs

44 lines
1.2 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";
_mockComms = new MockComms();
_mockComms.Connect();
_vm = new AcroModeConfigVm(_mockComms);
}
[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, _mockComms.SentItems.Count);
Assert.AreEqual("O5;6;7;1;2;3;8;9;10;4", _mockComms.SentItems[0]);
}
}
}