Exemple #1
0
        static void Main(string[] args)
        {
            var client = new PleskClient("192.168.2.136", "admin", "Osman12!");

            //var result = client.CreateSite("testdom.com", 2, true, true, true, true, false, false, false, false, false, false, false, "none", true, false);

            //Console.WriteLine(result.site.addResult.result.status);

            //if (result.site.addResult.result.status == "error")
            //{
            //    Console.WriteLine(result.site.addResult.result.ErrorText);
            //}
            //else
            //{
            //    Console.WriteLine("Success");
            //    Console.WriteLine(result.site.addResult.result.guid);
            //    Console.WriteLine(result.site.addResult.result.Id);
            //}

            var result = client.CreateWebSpace("domdon.com", "192.168.2.136", "domdon.com", "Osman12!");

            Console.WriteLine(result.webspace.add.result.status);
            Console.WriteLine(result.webspace.add.result.ErrorText);
            Console.WriteLine(result.webspace.add.result.guid);
            Console.WriteLine(result.webspace.add.result.Id);
        }
Exemple #2
0
        public void Add_WebSpace_Test()
        {
            using (var fakeServer = new FakeServer(BASE_PORT))
            {
                fakeServer.Expect.Post("/enterprise/control/agent.php", "").Returns(System.Net.HttpStatusCode.OK, WEBSPACE_RESULT);
                fakeServer.Start();

                var result = client.CreateWebSpace("domain.com", "192.168.0.1", "ftplogin", "password", "username", "password");

                Debug.WriteLine(result.ErrorText);

                Assert.AreEqual(result.status, "ok");
                Assert.AreEqual(result.Id, "4");
                Assert.AreEqual(result.guid, "5ff343c1-a40b-4305-8986-2f27c240db7e");
            }
        }