protected JObject Parm1Is101Parm2IsMostSimple1() { var parm1 = new JObject(new JProperty("value", 101)); var parm2 = new JObject(new JProperty("value", JsonRep.MostSimple1AsRef())); return(new JObject(new JProperty("parm1", parm1), new JProperty("parm2", parm2))); }
public void DoAnActionWithReferenceParameter() { var parm = new JObject(new JProperty("value", JsonRep.MostSimple1AsRef())); var parms = new JObject(new JProperty("parm2", parm)); //"parm2" is correct! TestActionInvoke("AnActionWithReferenceParameter", parms.ToString(), Methods.Post); }
public void DoSemanticallyMalformedParameters() { var parm1 = new JObject(new JProperty("value", "foo")); //i.e. string where it should be integer var parm2 = new JObject(new JProperty("value", JsonRep.MostSimple1AsRef())); var parms = new JObject(new JProperty("parm1", parm1), new JProperty("parm2", parm2)); TestActionInvoke(Domain.AnActionReturnsVoidWithParameters, parms.ToString(), Methods.Post, Codes.SyntacticallyInvalid); }
protected void DoSyntacticallyMalformedParamsAsEncodedMap2() { var parm1 = new JObject(new JProperty("value", 101)); var parm2 = new JObject(new JProperty("value", JsonRep.MostSimple1AsRef())); var parms = new JObject(new JProperty("parm1", parm1), new JProperty("parm2", parm2), new JProperty("parm3", parm2)); //Additional param TestActionInvoke("AnActionReturnsObjectWithParametersAnnotatedQueryOnly", parms.ToString(), Methods.Get, Codes.SyntacticallyInvalid); }
public void DoSyntacticallyMalformedParameters() { var parm1 = new JObject(new JProperty("value", 101)); var parm2 = new JObject(new JProperty("value", JsonRep.MostSimple1AsRef())); var parms = new JObject(new JProperty("parm1", parm1), new JProperty("param2", parm2)); //i.e. mis-named parameter TestActionInvoke(Domain.AnActionReturnsVoidWithParameters, parms.ToString(), Methods.Post, Codes.SyntacticallyInvalid); parms = new JObject(new JProperty("parm1", parm1), new JProperty("param2", parm2), new JProperty("parm3", parm2)); //i.e. additional parameter TestActionInvoke(Domain.AnActionReturnsVoidWithParameters, parms.ToString(), Methods.Post, Codes.SyntacticallyInvalid); // invalid json string invalidParms = @"{""parm1"" : {""value"" : 101} ""parm2"" : {""value"" : " + JsonRep.MostSimple1AsRef() + " }} "; // missing , parms = new JObject(new JProperty("parm1", parm1), new JProperty("param2", parm2), new JProperty("parm3", parm2)); //i.e. additional parameter TestActionInvoke(Domain.AnActionReturnsVoidWithParameters, parms.ToString(), Methods.Post, Codes.SyntacticallyInvalid); }