Esempio n. 1
0
        private void VerifySecondPass(ModuleKind module, ModuleKind modules
                                      , string expectedOutputDirectory, string expectedResponsePath
                                      , out GeneratedSyntaxTreeRegistry registrySet
                                      , bool usingResponseFile = DoNotUseResponseFile)
        {
            // Do a little Fact checking of the parameters.
            module.Distinct().ToArray().AssertTrue(x => x.Length == 1);
            modules.Distinct().ToArray().AssertTrue(x => x.Length >= 0);

            VerifyWithOperators(
                bundle => bundle.AddClassAnnotation <ImplementCloneableInterfaceAttribute>(module)
                , args =>
            {
                /* Should add all of the modules that would ordinarily be discovered
                * on the heels of analyzing for the Code Generation Attribute(s). */

                args.AddSources($"{Bundle.GetFilePath(module)}");
                args.AddSources(modules.Distinct().Select(x => $"{Bundle.GetFilePath(x)}").ToArray());

                args.AddDefines("DEBUG");

                if (usingResponseFile)
                {
                    args.UsingResponseFile = true;
                }

                // Ditto immediate verification.
                args.UsingResponseFile.AssertTrue(x => x == usingResponseFile);
            }
                , out registrySet).AssertEqual(DefaultErrorLevel);

            registrySet
            .VerifyRegistry(expectedOutputDirectory, 2)
            .VerifyResponseFile(expectedOutputDirectory, expectedResponsePath)
            ;
        }
Esempio n. 2
0
        private void VerifySinglePass(ModuleKind modules, ModuleKind module
                                      , string expectedOutputDirectory, string expectedResponsePath
                                      , out GeneratedSyntaxTreeRegistry registrySet
                                      , bool usingResponseFile = DoNotUseResponseFile)
        {
            // Do a little Fact checking of the parameters.
            modules.Distinct().ToArray().AssertTrue(x => x.Length > 1);
            module.Distinct().ToArray().AssertTrue(x => x.Length == 1);

            // TODO: TBD: some amount of this is "fixturing" I think...
            // TODO: TBD: but how much of it truly?
            VerifyWithOperators(
                bundle =>
            {
                bundle.Extrapolate(modules);
                bundle.AddClassAnnotation <ImplementBuzInterfaceAttribute>(module);
            }
                , args =>
            {
                args.AddSources($"{Bundle.GetFilePath(module)}");
                args.AddDefines("DEBUG");
                if (usingResponseFile)
                {
                    args.UsingResponseFile = true;
                }

                // And do an immediate verification that we set it correctly.
                args.UsingResponseFile.AssertTrue(x => x == usingResponseFile);
            }
                , out registrySet).AssertEqual(DefaultErrorLevel);

            registrySet
            .VerifyRegistry(expectedOutputDirectory, 1)
            .VerifyResponseFile(expectedOutputDirectory, expectedResponsePath)
            ;
        }