protected void CreateCodeModel()
        {
            ISolution solution = ProjectHelper.CreateSolutionWithoutInitializingServicesForUnitTests();

            msbuildProject = ProjectHelper.CreateTestProject(solution, "MyProject");

            projectService = MockRepository.GenerateStub <IPackageManagementProjectService>();
            fileService    = MockRepository.GenerateStub <IPackageManagementFileService>();
            dteProject     = new Project(msbuildProject, projectService, fileService);
            codeModelContext.DteProject = dteProject;

            codeModel = new CodeModel(codeModelContext, dteProject);

            msbuildProject.SetAssemblyModel(assemblyModel);
            project.Stub(p => p.AssemblyModel).Return(assemblyModel);

            fileService
            .Stub(fs => fs.GetCompilationUnit(msbuildProject))
            .WhenCalled(compilation => compilation.ReturnValue = CreateCompilation());
        }