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);
        }
        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);
        }
        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);
        }
Exemple #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);
            }
        }
 public void StepsToRunWithRunToBodyStepFails()
 {
     Assert.Throws <InvalidOperationException>(() => CommandRequestBuilder.Build(CommandType.Run, stepsToRun: 10, runToBodyStep: true));
 }
        public void WritesReadsCommand()
        {
            var message = CommandRequestBuilder.Build(CommandType.Run);

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