public void DefaultValuesDoNotSerialize() { Func <SarifLog, SarifLog> callback = (sarifLog) => { var visitor = new OverridePrimitiveArraysPopulatingVisitor(); return(visitor.VisitSarifLog(sarifLog)); }; ValidateDefaultDocument( propertyValueBuilders: DefaultObjectPopulatingVisitor.GetBuildersForRequiredPrimitives(), postPopulationCallback: callback); }
public void ValidatesUriConversion() { // First, we start with builders that only populate required properties that are backed by primitives. IDictionary <Type, DefaultObjectPopulatingVisitor.PrimitiveValueBuilder> propertyValueBuilders = DefaultObjectPopulatingVisitor.GetBuildersForRequiredPrimitives(); // This test injects a URI into every URI-based property in the format that is a file path with a space. // This URI won't be properly percent-encoded unless our UriConverter was invoked during seriallization. // This test therefore ensures that all URI's in the format are properly associated with that converter. propertyValueBuilders[typeof(Uri)] = (isRequired) => { return(new Uri(@"c:\path with a space\file.txt")); }; ValidateDefaultDocument(propertyValueBuilders); }
public void DefaultValuesDoNotSerialize() { ValidateDefaultDocument(propertyValueBuilders: DefaultObjectPopulatingVisitor.GetBuildersForRequiredPrimitives()); }