Exemplo n.º 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);
            }
        }
Exemplo n.º 2
0
 public void TestFunctions(string testFile, TemplatrTestCase testCase)
 {
     DoTest(testFile, testCase);
 }
Exemplo n.º 3
0
 public void TestInvalidSpecs(TemplatrTestCase testCase, JObject spec)
 {
     FluentActions
     .Invoking(() => testCase.GetTemplatr(spec))
     .Should().Throw <SpecException>();
 }