public void CorrectRequestForAddForwardingRules() { var factory = Substitute.For <IConnection>(); var client = new LoadBalancerClient(factory); var requestBody = new ForwardingRulesList() { ForwardingRules = new List <ForwardingRule>() { new ForwardingRule() } }; client.AddForwardingRules("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.POST); }