ardupilot/Configurator/Configurator.Net/Test/AcroModeConfigVmTest.cs
mandrolic b9e2dcd124 Configurator.Net: Added more Vm tests
git-svn-id: https://arducopter.googlecode.com/svn/trunk@1227 f9c3cf11-9bcb-44bc-f272-b75c42450872
2010-12-22 10:04:16 +00:00

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]);
}
}
}