Ejemplo n.º 1
0
        public void ReadAfterStopBufferingTest()
        {
            IEnumerable <BufferingJsonReaderTestCaseDescriptor> testCases = new BufferingJsonReaderTestCaseDescriptor[]
            {
                new BufferingJsonReaderTestCaseDescriptor
                {
                    JsonText = jsonPayload,
                    RemoveDuplicateProperties = false,
                },
                new BufferingJsonReaderTestCaseDescriptor
                {
                    JsonText = jsonPayload,
                    RemoveDuplicateProperties = true,
                },
                new BufferingJsonReaderTestCaseDescriptor
                {
                    JsonText = jsonPropertyDeduplicationPayload,
                    RemoveDuplicateProperties = false,
                },
                new BufferingJsonReaderTestCaseDescriptor
                {
                    JsonText = jsonPropertyDeduplicationPayload,
                    RemoveDuplicateProperties = true,
                },
            };

            IEnumerable <int[]> toggleBufferingCallCountsList = new int[][]
            {
                new int[] { 0, 1 },
                new int[] { 0, 3 },
                new int[] { 1, 2 },
                new int[] { 2, 5 },
                new int[] { 10, 11 },
                new int[] { 0, 0 },
                new int[] { 5, 5 },
            };

            this.CombinatorialEngineProvider.RunCombinations(
                testCases,
                toggleBufferingCallCountsList,
                (testCase, toggleBufferingCallCounts) =>
            {
                testCase = new BufferingJsonReaderTestCaseDescriptor(testCase)
                {
                    ToggleBufferingCallCounts = toggleBufferingCallCounts
                };

                JsonReaderUtils.ReadAndVerifyStateAfterStopBuffering(testCase, this.Assert);
            });
        }