예제 #1
0
        /// <summary>
        /// Pretty much encapsulates the Round Trip invocation of the <see cref="Main"/> method
        /// exposed in the Code Generation Tooling. This is as comprehensive an integration test
        /// as there is short of calling out to the Command Line Process itself, never mind wiring
        /// up the Microsoft Build targets.
        /// </summary>
        /// <param name="bundleVisitor"></param>
        /// <param name="paramsVisitor"></param>
        /// <param name="registrySet"></param>
        /// <returns></returns>
        internal virtual int VerifyWithOperators(
            TestCaseBundleOperator bundleVisitor
            , ToolingParameterOperator paramsVisitor
            , out GeneratedSyntaxTreeRegistry registrySet)
        {
            bundleVisitor?.Invoke(Bundle);

            var builder = new ToolingParameterBuilder {
                Project = $"{Bundle.ProjectName}"
            }
            .AddReferenceToTypeAssembly <object>()
            .AddTypeAssemblyLocationBasedReferences <object>("netstandard.dll", "System.Runtime.dll")
            .AddReferenceToTypeAssembly <ImplementBuzInterfaceAttribute>()
            ;

            paramsVisitor?.Invoke(builder);

            var verified = Verify(builder.ToArray());

            // Using the default surrogate implicit type conversion.
            TryLoad(Combine(builder.Output, builder.Generated), out registrySet
                    , GeneratedSyntaxTreeRegistryJsonConverter.Converter)
            .AssertEqual(registrySet?.Any() == true)
            ;

            return(verified);
        }
예제 #2
0
 /// <summary>
 /// Pretty much encapsulates the Round Trip invocation of the <see cref="Main"/> method
 /// exposed in the Code Generation Tooling. This is as comprehensive an integration test
 /// as there is short of calling out to the Command Line Process itself, never mind wiring
 /// up the Microsoft Build targets.
 /// </summary>
 /// <param name="bundleOp"></param>
 /// <param name="parameterOp"></param>
 /// <returns></returns>
 /// <see cref="VerifyWithOperators(TestCaseBundleOperator,ToolingParameterOperator,out GeneratedSyntaxTreeRegistry)"/>
 internal virtual int VerifyWithOperators(TestCaseBundleOperator bundleOp, ToolingParameterOperator parameterOp)
 => VerifyWithOperators(bundleOp, parameterOp, out _);