コード例 #1
0
        public void WritesReadsRunStepsCommand()
        {
            var message = CommandRequestBuilder.Build(CommandType.Run, stepsToRun: 1);

            var commandRequest = message.GetRequest(new CommandRequest());

            Assert.Equal(CommandType.Run, commandRequest.Command);
            Assert.Equal((uint)1, commandRequest.StepsToRun);
        }
コード例 #2
0
        public void WritesReadsRunToBodyStepCommand()
        {
            var message = CommandRequestBuilder.Build(CommandType.Run, runToBodyStep: true);

            var commandRequest = message.GetRequest(new CommandRequest());

            Assert.Equal(CommandType.Run, commandRequest.Command);
            Assert.True(commandRequest.RunToBodyStep);
        }
コード例 #3
0
        public void WritesReadsConfigurationCommand()
        {
            var systemConfig = new SystemConfiguration()
            {
                BrainStepsPerBodyStep = 13
            };
            var message = CommandRequestBuilder.Build(CommandType.Configure, configuration: new CoreConfiguration(systemConfig));

            CommandRequest commandRequest = message.GetRequest(new CommandRequest());

            Assert.Equal(CommandType.Configure, commandRequest.Command);
            Assert.Equal(systemConfig.ToJsonString(), commandRequest.Configuration.SystemConfiguration);
        }
コード例 #4
0
 public void StepsToRunWithRunToBodyStepFails()
 {
     Assert.Throws <InvalidOperationException>(() => CommandRequestBuilder.Build(CommandType.Run, stepsToRun: 10, runToBodyStep: true));
 }
コード例 #5
0
        public void WritesReadsCommand()
        {
            var message = CommandRequestBuilder.Build(CommandType.Run);

            Assert.Equal(CommandType.Run, message.GetRequest(new CommandRequest()).Command);
        }