public void Add_Hosting() { var controller = new HostingWindowsController(new HostingServiceWindowsPanel()); HostingPlanInfo hpi = new HostingPlanInfo() { UserId = 2, PlanId = 0, IsAddon = false, PlanName = "varsayilan-plan-markumdestek", PlanDescription = null, Available = true, SetupPrice = 0, RecurringPrice = 0, RecurrenceLength = 1, RecurrenceUnit = 2, PackageId = 2, ServerId = 0, }; hpi.Groups = new HostingPlanGroupInfo[] { new HostingPlanGroupInfo() { CalculateBandwidth = true, CalculateDiskSpace = true, GroupId = 1 }, new HostingPlanGroupInfo() { CalculateBandwidth = true, CalculateDiskSpace = true, GroupId = 2 }, new HostingPlanGroupInfo() { CalculateBandwidth = true, CalculateDiskSpace = true, GroupId = 3 }, new HostingPlanGroupInfo() { CalculateBandwidth = true, CalculateDiskSpace = true, GroupId = 11 }, new HostingPlanGroupInfo() { CalculateBandwidth = true, CalculateDiskSpace = true, GroupId = 7 }, new HostingPlanGroupInfo() { CalculateBandwidth = true, CalculateDiskSpace = true, GroupId = 8 }, new HostingPlanGroupInfo() { CalculateBandwidth = true, CalculateDiskSpace = true, GroupId = 22 }, }; hpi.Quotas = new HostingPlanQuotaInfo[] { new HostingPlanQuotaInfo() { QuotaId = 70, QuotaValue = 1 }, new HostingPlanQuotaInfo() { QuotaId = 106, QuotaValue = 250 }, new HostingPlanQuotaInfo() { QuotaId = 107, QuotaValue = 1 }, new HostingPlanQuotaInfo() { QuotaId = 108, QuotaValue = 1 }, new HostingPlanQuotaInfo() { QuotaId = 211, QuotaValue = 2 }, new HostingPlanQuotaInfo() { QuotaId = 212, QuotaValue = 2 }, new HostingPlanQuotaInfo() { QuotaId = 213, QuotaValue = 50 }, new HostingPlanQuotaInfo() { QuotaId = 214, QuotaValue = 1 }, new HostingPlanQuotaInfo() { QuotaId = 215, QuotaValue = 1 }, new HostingPlanQuotaInfo() { QuotaId = 216, QuotaValue = 1 }, new HostingPlanQuotaInfo() { QuotaId = 217, QuotaValue = 20 }, }; string message = ""; ApiBaseModel model = new ApiBaseModel() { PanelApiUsername = apiUser, PanelApiCryptokey = key, PanelApiPassword = pwd, PanelApiUrl = url }; var result = controller.AddHosting(hpi, model, out message); Assert.IsNotNull(result); Assert.AreEqual(result.ToString(), "1"); }
public void EmulateHostingCreating() { ApiBaseModel model = new ApiBaseModel() { PanelApiUsername = apiUser, PanelApiCryptokey = key, PanelApiPassword = pwd, PanelApiUrl = url }; // validation will be implemented before service call in panel and core projects if (_isReseller) { var controller = new HostingWindowsController(new HostingServiceWindowsPanel()); HostingPlanInfo hpi = new HostingPlanInfo() { UserId = 1, PlanId = 0, IsAddon = false, PlanName = "Standart Plan", PlanDescription = "", Available = true, SetupPrice = 0, RecurringPrice = 0, RecurrenceLength = 1, RecurrenceUnit = 2, PackageId = 808, ServerId = 0, }; hpi.Groups = new HostingPlanGroupInfo[] { new HostingPlanGroupInfo() { CalculateBandwidth = true, CalculateDiskSpace = true, GroupId = 1 }, new HostingPlanGroupInfo() { CalculateBandwidth = true, CalculateDiskSpace = true, GroupId = 2 }, new HostingPlanGroupInfo() { CalculateBandwidth = true, CalculateDiskSpace = true, GroupId = 3 }, new HostingPlanGroupInfo() { CalculateBandwidth = true, CalculateDiskSpace = true, GroupId = 11 }, new HostingPlanGroupInfo() { CalculateBandwidth = true, CalculateDiskSpace = true, GroupId = 7 }, new HostingPlanGroupInfo() { CalculateBandwidth = true, CalculateDiskSpace = true, GroupId = 8 }, new HostingPlanGroupInfo() { CalculateBandwidth = true, CalculateDiskSpace = true, GroupId = 22 }, }; hpi.Quotas = new HostingPlanQuotaInfo[] { new HostingPlanQuotaInfo() { QuotaId = 70, QuotaValue = 1 }, new HostingPlanQuotaInfo() { QuotaId = 106, QuotaValue = 250 }, new HostingPlanQuotaInfo() { QuotaId = 107, QuotaValue = 1 }, new HostingPlanQuotaInfo() { QuotaId = 108, QuotaValue = 1 }, new HostingPlanQuotaInfo() { QuotaId = 211, QuotaValue = 2 }, new HostingPlanQuotaInfo() { QuotaId = 212, QuotaValue = 2 }, new HostingPlanQuotaInfo() { QuotaId = 213, QuotaValue = 50 }, new HostingPlanQuotaInfo() { QuotaId = 214, QuotaValue = 1 }, new HostingPlanQuotaInfo() { QuotaId = 215, QuotaValue = 1 }, new HostingPlanQuotaInfo() { QuotaId = 216, QuotaValue = 1 }, new HostingPlanQuotaInfo() { QuotaId = 217, QuotaValue = 20 }, }; string message = ""; var result = controller.AddHosting(hpi, model, out message); //var result = controller.AddHosting(hpi, url, apiUser, parola, key, out message); } //s1------------------------------------------- var controller2 = new HostingWindowsController(new HostingServiceWindowsPanel()); string serviceId = "2"; string wspipaddressid = null; string message2 = ""; if (wspipaddressid != null) { var result2 = controller2.UpdateServiceSettings(model, serviceId, wspipaddressid, out message2); //var result2 = controller2.UpdateServiceSettings(url, apiUser, parola, key, serviceId, wspipaddressid, out message2); } //s2-------------------- var controller3 = new HostingWindowsController(new HostingServiceWindowsPanel()); UserInfo user = new UserInfo(); user.UserId = 0; user.Role = UserRole.User; user.StatusId = 1; user.OwnerId = 2; user.IsDemo = false; user.IsPeer = false; user.FirstName = "hamit"; user.LastName = "yildirim"; user.Email = "*****@*****.**"; user.Username = "******"; user.Password = "******"; string message3 = ""; var result3 = controller3.AddUser(user, model, out message3); //var result3 = controller3.AddUser(user, url, apiUser, parola, key, out message3); //s3 -------------------------------- var controller4 = new HostingWindowsController(new HostingServiceWindowsPanel()); string message4 = ""; var result4 = controller4.AddPackageWithResources(model, 808, 808, "Standart Plan", targetDomainName, out message4); //var result4 = controller4.AddPackageWithResources(url, apiUser, parola, key, 986, 6, targetDomainName, out message4); }