public void ParseCorrectly(ModelTestParam <TModel> param) { Output.WriteLine("Parsing JSON: " + param.Description); Output.WriteLine(param.Json); var parsed = JsonSerializer.Deserialize <TModel>(param.Json); var expected = param.ModifyExpected(Expected); Assert.NotNull(expected); Assert.NotNull(parsed); Compare(expected, parsed); }
public ParamBuilder AddTestsFor <TV>(Expression <Func <TModel, IReadOnlyList <TV> > > prop, IReadOnlyList <TV> nonEmptyValue) { _params.AddRange(ModelTestParam <TModel> .CreateForProperty(_defJson, prop, nonEmptyValue)); return(this); }
public ParamBuilder AddTestsFor(Expression <Func <TModel, DateTime> > prop) { _params.AddRange(ModelTestParam <TModel> .CreateForProperty(_defJson, prop)); return(this); }
public ParamBuilder AddTestFor(Expression <Func <TModel, object> > prop, object testValue, object expectedValue) { _params.Add(ModelTestParam <TModel> .CreateExplicit(_defJson, prop, testValue, expectedValue)); return(this); }