public void ComplexResponseTypeShouldHaveFieldsWithAttributes() { InterfaceSchema schema = new InterfaceSchema(typeof(IHasReturnType)); schema.Methods.First().Response.Fields.Length.ShouldBe(2); (schema.Methods.First().Response.Fields.First().Attributes.Single().Attribute is JsonPropertyAttribute).ShouldBeTrue(); }
public void RequestParamShouldBeWithoutAttribute(Type type) { InterfaceSchema schema = new InterfaceSchema(type); foreach (var parameter in schema.Methods.First().Parameters) { parameter.Attributes.ShouldBeEmpty(); } }
public void ShouldHendleRevocable() { InterfaceSchema schema = new InterfaceSchema(typeof(IHasRevocableReturn)); schema.Methods.First().Response.Fields.Length.ShouldBe(2); InterfaceSchema schema2 = new InterfaceSchema(typeof(IHasReturnType)); schema2.Methods.First().IsRevocable.ShouldNotBe(schema.Methods.First().IsRevocable); }
public void ReqestParamWithComplexObjectShouldHaveAttrbute(Type type) { InterfaceSchema schema = new InterfaceSchema(type); schema.Methods.First().Parameters.First().Fields.First().Attributes.Length.ShouldBe(1); }
public void ResponseShouldBeNullForMethodWithoutResponseType() { InterfaceSchema schema = new InterfaceSchema(typeof(INoRetrunObject)); schema.Methods.First().Response.ShouldBeNull(); }
public void MethodShouldHaveOneParam(Type type) { InterfaceSchema schema = new InterfaceSchema(type); schema.Methods.First().Parameters.Length.ShouldBe(1); }
public void SimpleResponseTypeShouldNotHaveFields(Type type) { InterfaceSchema schema = new InterfaceSchema(type); schema.Methods.First().Response.Fields.ShouldBeNull(); }