static public void TestInit(TestContext context)
        {
            var ports = new List <POCO.Requests.MonitoringPolicies.Ports>();

            ports.Add(new POCO.Requests.MonitoringPolicies.Ports()
            {
                EmailNotification = true,
                AlertIf           = AlertIfType.RESPONDING,
                Port     = 22,
                Protocol = ProtocolType.TCP
            });
            var processes = new List <POCO.Requests.MonitoringPolicies.Processes>();

            processes.Add(new POCO.Requests.MonitoringPolicies.Processes()
            {
                EmailNotification = true,
                AlertIf           = ProcessAlertType.NOT_RUNNING,
                Process           = "test",
            });
            var request = new POCO.Requests.MonitoringPolicies.CreateMonitoringPolicyRequest()
            {
                Name        = ".net MP Process test",
                Description = ".net decription",
                Agent       = true,
                Ports       = ports,
                Processes   = processes,
                Thresholds  = new POCO.Requests.MonitoringPolicies.Thresholds()
                {
                    Cpu = new POCO.Requests.MonitoringPolicies.Cpu()
                    {
                        Critical = new POCO.Requests.MonitoringPolicies.Critical()
                        {
                            Alert = false,
                            Value = 95
                        },
                        Warning = new POCO.Requests.MonitoringPolicies.Warning()
                        {
                            Alert = false,
                            Value = 90
                        }
                    },
                    Ram = new POCO.Requests.MonitoringPolicies.Ram()
                    {
                        Critical = new POCO.Requests.MonitoringPolicies.Critical()
                        {
                            Alert = false,
                            Value = 95
                        },
                        Warning = new POCO.Requests.MonitoringPolicies.Warning()
                        {
                            Alert = false,
                            Value = 90
                        }
                    },
                    Disk = new POCO.Requests.MonitoringPolicies.Disk()
                    {
                        Critical = new POCO.Requests.MonitoringPolicies.DiskCritical()
                        {
                            Alert = false,
                            Value = 90
                        },
                        Warning = new POCO.Requests.MonitoringPolicies.DiskWarning()
                        {
                            Alert = false,
                            Value = 80
                        }
                    },
                    InternalPing = new POCO.Requests.MonitoringPolicies.InternalPing()
                    {
                        Critical = new POCO.Requests.MonitoringPolicies.InternalPingCritical()
                        {
                            Alert = false,
                            Value = 100
                        },
                        Warning = new POCO.Requests.MonitoringPolicies.InternalPingWarning()
                        {
                            Alert = false,
                            Value = 50
                        }
                    },
                    Transfer = new POCO.Requests.MonitoringPolicies.Transfer()
                    {
                        Critical = new POCO.Requests.MonitoringPolicies.TransferCritical()
                        {
                            Alert = false,
                            Value = 2000
                        },
                        Warning = new POCO.Requests.MonitoringPolicies.Warning()
                        {
                            Alert = false,
                            Value = 1000
                        }
                    }
                }
            };
            var result = client.MonitoringPolicies.Create(request);

            mp = result;

            Config.waitMonitoringPolicyReady(mp.Id);

            var newProcesses = new List <POCO.Requests.MonitoringPolicies.Processes>();

            newProcesses.Add(new POCO.Requests.MonitoringPolicies.Processes()
            {
                EmailNotification = true,
                AlertIf           = ProcessAlertType.RUNNING,
                Process           = "iexplorer"
            });

            newProcesses.Add(new POCO.Requests.MonitoringPolicies.Processes()
            {
                EmailNotification = true,
                AlertIf           = ProcessAlertType.RUNNING,
                Process           = "test"
            });

            updatedMp = client.MonitoringPoliciesProcesses.Create(newProcesses, mp.Id);


            Assert.IsNotNull(updatedMp);
            Assert.IsNotNull(updatedMp.Id);

            Config.waitMonitoringPolicyReady(mp.Id);
        }
        static public void TestInit(TestContext context)
        {
            var ports = new List <POCO.Requests.MonitoringPolicies.Ports>();

            ports.Add(new POCO.Requests.MonitoringPolicies.Ports()
            {
                EmailNotification = true,
                AlertIf           = AlertIfType.RESPONDING,
                Port     = 22,
                Protocol = ProtocolType.TCP
            });
            var processes = new List <POCO.Requests.MonitoringPolicies.Processes>();

            processes.Add(new POCO.Requests.MonitoringPolicies.Processes()
            {
                EmailNotification = true,
                AlertIf           = ProcessAlertType.NOT_RUNNING,
                Process           = "test",
            });
            var request = new POCO.Requests.MonitoringPolicies.CreateMonitoringPolicyRequest()
            {
                Name        = ".net MP test",
                Description = ".net decription",
                Agent       = true,
                Ports       = ports,
                Processes   = processes,
                Thresholds  = new POCO.Requests.MonitoringPolicies.Thresholds()
                {
                    Cpu = new POCO.Requests.MonitoringPolicies.Cpu()
                    {
                        Critical = new POCO.Requests.MonitoringPolicies.Critical()
                        {
                            Alert = false,
                            Value = 95
                        },
                        Warning = new POCO.Requests.MonitoringPolicies.Warning()
                        {
                            Alert = false,
                            Value = 90
                        }
                    },
                    Ram = new POCO.Requests.MonitoringPolicies.Ram()
                    {
                        Critical = new POCO.Requests.MonitoringPolicies.Critical()
                        {
                            Alert = false,
                            Value = 95
                        },
                        Warning = new POCO.Requests.MonitoringPolicies.Warning()
                        {
                            Alert = false,
                            Value = 90
                        }
                    },
                    Disk = new POCO.Requests.MonitoringPolicies.Disk()
                    {
                        Critical = new POCO.Requests.MonitoringPolicies.DiskCritical()
                        {
                            Alert = false,
                            Value = 90
                        },
                        Warning = new POCO.Requests.MonitoringPolicies.DiskWarning()
                        {
                            Alert = false,
                            Value = 80
                        }
                    },
                    InternalPing = new POCO.Requests.MonitoringPolicies.InternalPing()
                    {
                        Critical = new POCO.Requests.MonitoringPolicies.InternalPingCritical()
                        {
                            Alert = false,
                            Value = 100
                        },
                        Warning = new POCO.Requests.MonitoringPolicies.InternalPingWarning()
                        {
                            Alert = false,
                            Value = 50
                        }
                    },
                    Transfer = new POCO.Requests.MonitoringPolicies.Transfer()
                    {
                        Critical = new POCO.Requests.MonitoringPolicies.TransferCritical()
                        {
                            Alert = false,
                            Value = 2000
                        },
                        Warning = new POCO.Requests.MonitoringPolicies.Warning()
                        {
                            Alert = false,
                            Value = 1000
                        }
                    }
                }
            };
            var result = client.MonitoringPolicies.Create(request);

            Assert.IsNotNull(result);
            Assert.IsNotNull(result.Id);
            var monitoringPolicyResult = client.MonitoringPolicies.Show(result.Id);

            mp = monitoringPolicyResult;
            Assert.AreEqual(monitoringPolicyResult.Agent, request.Agent);
            Assert.AreEqual(monitoringPolicyResult.Ports.Count, request.Ports.Count);
            Assert.AreEqual(monitoringPolicyResult.Processes.Count, request.Processes.Count);
            //check CPU values
            Assert.AreEqual(monitoringPolicyResult.Thresholds.Cpu.Critical.Alert, request.Thresholds.Cpu.Critical.Alert);
            Assert.AreEqual(monitoringPolicyResult.Thresholds.Cpu.Critical.Value, request.Thresholds.Cpu.Critical.Value);
            Assert.AreEqual(monitoringPolicyResult.Thresholds.Cpu.Warning.Alert, request.Thresholds.Cpu.Warning.Alert);
            Assert.AreEqual(monitoringPolicyResult.Thresholds.Cpu.Warning.Value, request.Thresholds.Cpu.Warning.Value);
            //check RAM values
            Assert.AreEqual(monitoringPolicyResult.Thresholds.Ram.Critical.Alert, request.Thresholds.Ram.Critical.Alert);
            Assert.AreEqual(monitoringPolicyResult.Thresholds.Ram.Critical.Value, request.Thresholds.Ram.Critical.Value);
            Assert.AreEqual(monitoringPolicyResult.Thresholds.Ram.Warning.Alert, request.Thresholds.Ram.Warning.Alert);
            Assert.AreEqual(monitoringPolicyResult.Thresholds.Ram.Warning.Value, request.Thresholds.Ram.Warning.Value);
            //check InternalPing values
            Assert.AreEqual(monitoringPolicyResult.Thresholds.InternalPing.Critical.Alert, request.Thresholds.InternalPing.Critical.Alert);
            Assert.AreEqual(monitoringPolicyResult.Thresholds.InternalPing.Critical.Value, request.Thresholds.InternalPing.Critical.Value);
            Assert.AreEqual(monitoringPolicyResult.Thresholds.InternalPing.Warning.Alert, request.Thresholds.InternalPing.Warning.Alert);
            Assert.AreEqual(monitoringPolicyResult.Thresholds.InternalPing.Warning.Value, request.Thresholds.InternalPing.Warning.Value);
            //check Transfer values
            Assert.AreEqual(monitoringPolicyResult.Thresholds.Transfer.Critical.Alert, request.Thresholds.Transfer.Critical.Alert);
            Assert.AreEqual(monitoringPolicyResult.Thresholds.Transfer.Critical.Value, request.Thresholds.Transfer.Critical.Value);
            Assert.AreEqual(monitoringPolicyResult.Thresholds.Transfer.Warning.Alert, request.Thresholds.Transfer.Warning.Alert);
            Assert.AreEqual(monitoringPolicyResult.Thresholds.Transfer.Warning.Value, request.Thresholds.Transfer.Warning.Value);
            Config.waitMonitoringPolicyReady(mp.Id);
        }
        static public void TestInit(TestContext context)
        {
            var ports = new List <POCO.Requests.MonitoringPolicies.Ports>();

            ports.Add(new POCO.Requests.MonitoringPolicies.Ports()
            {
                EmailNotification = true,
                AlertIf           = AlertIfType.RESPONDING,
                Port     = 22,
                Protocol = ProtocolType.TCP
            });
            var processes = new List <POCO.Requests.MonitoringPolicies.Processes>();

            processes.Add(new POCO.Requests.MonitoringPolicies.Processes()
            {
                EmailNotification = true,
                AlertIf           = ProcessAlertType.NOT_RUNNING,
                Process           = "test",
            });
            var request = new POCO.Requests.MonitoringPolicies.CreateMonitoringPolicyRequest()
            {
                Name        = ".net MP test",
                Description = ".net decription",
                Agent       = true,
                Ports       = ports,
                Processes   = processes,
                Thresholds  = new POCO.Requests.MonitoringPolicies.Thresholds()
                {
                    Cpu = new POCO.Requests.MonitoringPolicies.Cpu()
                    {
                        Critical = new POCO.Requests.MonitoringPolicies.Critical()
                        {
                            Alert = false,
                            Value = 95
                        },
                        Warning = new POCO.Requests.MonitoringPolicies.Warning()
                        {
                            Alert = false,
                            Value = 90
                        }
                    },
                    Ram = new POCO.Requests.MonitoringPolicies.Ram()
                    {
                        Critical = new POCO.Requests.MonitoringPolicies.Critical()
                        {
                            Alert = false,
                            Value = 95
                        },
                        Warning = new POCO.Requests.MonitoringPolicies.Warning()
                        {
                            Alert = false,
                            Value = 90
                        }
                    },
                    Disk = new POCO.Requests.MonitoringPolicies.Disk()
                    {
                        Critical = new POCO.Requests.MonitoringPolicies.DiskCritical()
                        {
                            Alert = false,
                            Value = 90
                        },
                        Warning = new POCO.Requests.MonitoringPolicies.DiskWarning()
                        {
                            Alert = false,
                            Value = 80
                        }
                    },
                    InternalPing = new POCO.Requests.MonitoringPolicies.InternalPing()
                    {
                        Critical = new POCO.Requests.MonitoringPolicies.InternalPingCritical()
                        {
                            Alert = false,
                            Value = 100
                        },
                        Warning = new POCO.Requests.MonitoringPolicies.InternalPingWarning()
                        {
                            Alert = false,
                            Value = 50
                        }
                    },
                    Transfer = new POCO.Requests.MonitoringPolicies.Transfer()
                    {
                        Critical = new POCO.Requests.MonitoringPolicies.TransferCritical()
                        {
                            Alert = false,
                            Value = 2000
                        },
                        Warning = new POCO.Requests.MonitoringPolicies.Warning()
                        {
                            Alert = false,
                            Value = 1000
                        }
                    }
                }
            };
            var result = client.MonitoringPolicies.Create(request);

            mp = result;

            Config.waitMonitoringPolicyReady(mp.Id);

            server = Config.CreateTestServer("mp servers test");

            Config.waitServerReady(server.Id);
            server = client.Servers.Show(server.Id);

            var servers = new List <string>();

            servers.Add(server.Id);

            var addedServer = client.MonitoringPoliciesServers.Create(servers, mp.Id);

            Assert.IsNotNull(addedServer);
            Assert.IsNotNull(addedServer.Id);
            //check if servers created do really exist
            var checkResult = client.MonitoringPolicies.Show(mp.Id);

            Assert.AreEqual(servers.Count, checkResult.Servers.Count);
            foreach (var item in servers)
            {
                var matchingServer = checkResult.Servers.FirstOrDefault(po => po.Id == item);
                Assert.AreEqual(item, matchingServer.Id);
            }
        }