Пример #1
0
        protected void ExecuteLoadBalancerUpdateMethod(object[] invokeMethodInputParameters)
        {
            string serviceName      = (string)ParseParameter(invokeMethodInputParameters[0]);
            string deploymentName   = (string)ParseParameter(invokeMethodInputParameters[1]);
            string loadBalancerName = (string)ParseParameter(invokeMethodInputParameters[2]);
            LoadBalancerUpdateParameters parameters = (LoadBalancerUpdateParameters)ParseParameter(invokeMethodInputParameters[3]);

            var result = LoadBalancerClient.Update(serviceName, deploymentName, loadBalancerName, parameters);

            WriteObject(result);
        }
Пример #2
0
        public void CorrectRequestForUpdate()
        {
            var factory = Substitute.For <IConnection>();
            var client  = new LoadBalancerClient(factory);

            var body = new LoadBalancer();

            client.Update(15, body);

            var parameters = Arg.Is <List <Parameter> >(list => (int)list[0].Value == 15);

            factory.Received().ExecuteRequest <Models.Responses.LoadBalancer>("load_balancers/{id}", parameters, body, "load_balancers", Method.PUT);
        }