示例#1
0
        public void CorrectRequestForRemoveForwardingRules()
        {
            var factory = Substitute.For <IConnection>();
            var client  = new LoadBalancerClient(factory);

            var requestBody = new ForwardingRulesList()
            {
                ForwardingRules = new List <ForwardingRule>()
                {
                    new ForwardingRule()
                }
            };

            client.RemoveForwardingRules("15", requestBody);

            var parameters = Arg.Is <List <Parameter> >(list => (string)list[0].Value == "15");
            var body       = Arg.Is <ForwardingRulesList>(ls => ls.ForwardingRules.SequenceEqual(requestBody.ForwardingRules));

            factory.Received().ExecuteRaw("load_balancers/{id}/forwarding_rules", parameters, body, Method.DELETE);
        }