Пример #1
0
        public void EditMonitor_AddMonitorEditAndDelete(OutputType output)
        {
            //Add monitor
            string testName = "test ping" + Common.GenerateRandomString(5);
            string newName  = "new name";/*edit name*/

            string url = "www.yandex.ru";
            string tag = tagNew;

            int[] locationsIds           = new int[] { 4, 11 };
            var   locationsIdAndIntrvals = new Dictionary <int, ExternalMonitor.CheckInterval>();

            //edit monitor id (4 -> 5)
            locationsIdAndIntrvals.Add(5, ExternalMonitor.CheckInterval.five);
            locationsIdAndIntrvals.Add(11, ExternalMonitor.CheckInterval.fifteen);

            var resultAddMonitor = externalMonitor.AddMonitor(
                ExternalMonitor.TestType.ping,
                testName,
                url,
                ExternalMonitor.CheckInterval.five,
                tag,
                output: output,
                locationIds: locationsIds);

            monitorsToDelete.Add(resultAddMonitor.testId);

            int uptimeSLA = 10;

            //Edit monitor
            externalMonitor.EditMonitor(resultAddMonitor.testId, name: newName, url: url, locationIdIntervals: locationsIdAndIntrvals,
                                        tag: tag, uptimeSLA: uptimeSLA, output: output);
        }