예제 #1
0
        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);
            }
        }
예제 #2
0
 public void TestInvalidSpecs(TemplatrTestCase testCase, JObject spec)
 {
     FluentActions
     .Invoking(() => testCase.GetTemplatr(spec))
     .Should().Throw <SpecException>();
 }