Exemple #1
0
        static void Main(string[] args)
        {
            var postCompilerArgs = new PostCompilerArgs(args);
            var postCompiler = new SharpMock.Core.PostCompiler.PostCompiler(postCompilerArgs, new ConsoleLogger());

            postCompiler.InterceptSpecifications();
            postCompiler.InterceptAllStaticMethodCalls();

            Console.WriteLine("Press any key to continue...");
            Console.ReadKey();
        }
        public override bool Execute()
        {
            try
            {
                var specPath = System.IO.Path.Combine(SearchLocation, SpecificationAssembly);

                var compiler = new SharpMock.Core.PostCompiler.PostCompiler(
                    new PostCompilerArgs(new[] { specPath, String.Empty }), new MSBuildLogger(Log));

                compiler.InterceptSpecifications();
            }
            catch (Exception e)
            {
                Log.LogError("InterceptMethodsTask failed with the following error: '{0}'.{1}{2}",
                             e.Message, Environment.NewLine, e.StackTrace);
                return false;
            }

            return true;
        }