コード例 #1
0
        public void Constructor_AssignsFloatToInt32Converter()
        {
            // Arrange

            // Act
            var result = new ProgressiveCommandFormatter();

            // Assert
            result.FloatToInt32Converter.Should().BeOfType <FloatToInt32Converter>();
        }
コード例 #2
0
        public void InitializeTests()
        {
            _mockFloatToInt32Converter = new Mock <FloatToInt32Converter>();
            _target = new ProgressiveCommandFormatter
            {
                FloatToInt32Converter = _mockFloatToInt32Converter.Object
            };
            _mockProgressiveCommand = new Mock <IProgressiveCommand>();

            AssignUnexpectedValuesToProperties();
        }
コード例 #3
0
        internal virtual void SendProgressiveCommand(IProgressiveCommand args)
        {
            string command;

            ProgressiveCommandFormatter.Load(args);

            if (args.AbsoluteControlMode)
            {
                string message = string.Format("{0},{1},{2},{3},{4},{5},{6}", (int)ProgressiveCommandFormatter.Mode,
                                               ProgressiveCommandFormatter.Roll, ProgressiveCommandFormatter.Pitch, ProgressiveCommandFormatter.Gaz,
                                               ProgressiveCommandFormatter.Yaw, ProgressiveCommandFormatter.MagnetoPsi,
                                               ProgressiveCommandFormatter.MagnetoPsiAccuracy);
                command = CommandFormatter.CreateCommand(PcmdMagCommand, message);
            }
            else
            {
                string message = string.Format("{0},{1},{2},{3},{4}", (int)ProgressiveCommandFormatter.Mode,
                                               ProgressiveCommandFormatter.Roll, ProgressiveCommandFormatter.Pitch, ProgressiveCommandFormatter.Gaz,
                                               ProgressiveCommandFormatter.Yaw);
                command = CommandFormatter.CreateCommand(PcmdCommand, message);
            }

            CommandQueue.Enqueue(command);
        }