Exemple #1
0
        public void process_itCallsSortr()
        {
            var input      = GetJson("sortr/simple/input");
            var expected   = GetJson("sortr/simple/output");
            var chainrSpec = NewShiftrSortrSpec(null);

            var unit   = Chainr.FromSpec(chainrSpec);
            var actual = unit.Transform(input, null);

            actual.Should().BeEquivalentTo(expected);

            String orderErrorMessage = SortrTest.VerifyOrder(actual, expected);

            orderErrorMessage.Should().BeNull(orderErrorMessage);
        }
Exemple #2
0
        public void RunTestCases(string testCaseName, bool sorted)
        {
            var testCase = GetTestCase($"chainr/integration/{testCaseName}");

            var unit = Chainr.FromSpec(testCase.Spec);

            unit.HasContextualTransforms().Should().BeFalse();
            unit.GetContextualTransforms().Count.Should().Be(0);

            var actual = unit.Transform(testCase.Input, null);

            actual.Should().BeEquivalentTo(testCase.Expected);

            if (sorted)
            {
                // Make sure the sort actually worked.
                var orderErrorMessage = SortrTest.VerifyOrder(actual, testCase.Expected);
                orderErrorMessage.Should().BeNull(orderErrorMessage);
            }
        }