Пример #1
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);
        }
Пример #2
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);
        }
Пример #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 SendStatistics()
        {
            var cmd = new GetSendStatisticsCommand();


            HttpWebRequest request = _builder.Build(cmd);

            Helper.ProcessRequest(request);

            var cp = new CommandProcessor(_builder);

            var stats = cp.Process(cmd, new GetSendStatisticsResponseParser());

            foreach (var stat in stats.SendStatistics)
            {
                Console.WriteLine("DeliveryAttempts : " + stat.DeliveryAttempts);
                Console.WriteLine("Timestamp : " + stat.Timestamp);
                Console.WriteLine("Bounces : " + stat.Bounces);
                Console.WriteLine("Rejects : " + stat.Rejects);
                Console.WriteLine("Complaints : " + stat.Complaints);
            }
        }
Пример #5
0
 public void StepsToRunWithRunToBodyStepFails()
 {
     Assert.Throws <InvalidOperationException>(() => CommandRequestBuilder.Build(CommandType.Run, stepsToRun: 10, runToBodyStep: true));
 }
Пример #6
0
        public void WritesReadsCommand()
        {
            var message = CommandRequestBuilder.Build(CommandType.Run);

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