public void InStreamAtomDeeplyRecursiveErrorTest() { int depthLimit = 5; IEnumerable <PayloadReaderTestDescriptor> testDescriptors = PayloadReaderTestDescriptorGenerator.CreateErrorDeeplyNestedReaderTestDescriptors(this.Settings, depthLimit); // Convert the payload element to an Xml representation usable for in-stream error testing testDescriptors = testDescriptors.Select(td => { XElement xmlPayload = this.PayloadElementToXmlConverter.ConvertToXml(td.PayloadElement); return(new PayloadReaderTestDescriptor(td) { PayloadElement = td.PayloadElement.XmlRepresentation(xmlPayload) }); }); // Convert top-level error test descriptors to in-stream errors. testDescriptors = testDescriptors.Select(td => td.ToInStreamErrorTestDescriptor(ODataFormat.Atom)); this.CombinatorialEngineProvider.RunCombinations( testDescriptors, this.ReaderTestConfigurationProvider.AtomFormatConfigurations.Where(tc => !tc.IsRequest), (testDescriptor, testConfiguration) => { // Copy the test configuration so we can modify the depth limit. testConfiguration = new ReaderTestConfiguration(testConfiguration); testConfiguration.MessageReaderSettings.MessageQuotas.MaxNestingDepth = depthLimit; testDescriptor.RunTest(testConfiguration); }); }
public void TopLevelDeeplyRecursiveErrorTest() { int depthLimit = 5; IEnumerable <PayloadReaderTestDescriptor> testDescriptors = PayloadReaderTestDescriptorGenerator.CreateErrorDeeplyNestedReaderTestDescriptors(this.Settings, depthLimit); this.CombinatorialEngineProvider.RunCombinations( testDescriptors, this.ReaderTestConfigurationProvider.ExplicitFormatConfigurations.Where(tc => !tc.IsRequest), (testDescriptor, testConfiguration) => { // Copy the test configuration so we can modify the depth limit. testConfiguration = new ReaderTestConfiguration(testConfiguration); testConfiguration.MessageReaderSettings.MessageQuotas.MaxNestingDepth = depthLimit; testDescriptor.RunTest(testConfiguration); }); }