Beispiel #1
0
        protected override void BeginProcessing()
        {
            try
            {
                var lanApi = new LanApi(Utilities.Configuration);

                var newProps = new LanProperties {
                    Public = this.Public
                };

                if (!string.IsNullOrEmpty(Name))
                {
                    newProps.Name = Name;
                }

                var newLan = lanApi.Create(DataCenterId, new Lan {
                    Properties = newProps
                });

                WriteObject(newLan);
            }
            catch (Exception ex)
            {
                WriteError(new ErrorRecord(ex, "", ErrorCategory.NotSpecified, null));
            }
        }
        public void LanCreate()
        {
            Configure();
            lan = new Lan {
                Properties = new LanProperties {
                    Public = true, Name = ".Net V2 - Test " + DateTime.Now.ToShortTimeString()
                }
            };

            lan = lanApi.Create(datacenter.Id, lan);
            DoWait(lan.Request);

            Assert.IsNotNull(lan);
        }