private void DoTest(string testFile, TemplatrTestCase testCase) { var testUnit = GetJson(testFile); var input = testUnit["input"]; var spec = (JObject)testUnit["spec"]; var context = (JObject)testUnit["context"]; var expected = testUnit[testCase.Name]; if (expected != null) { var modifier = testCase.GetTemplatr(spec); var actual = modifier.Transform(input, context); actual.Should().BeEquivalentTo(expected); } }
public void TestInvalidSpecs(TemplatrTestCase testCase, JObject spec) { FluentActions .Invoking(() => testCase.GetTemplatr(spec)) .Should().Throw <SpecException>(); }