public override void MainSetup()
        {
            base.MainSetup();

            _sourceFile.Source =
                string.Format(
                    SourceCodeFormat,
                    //don't add the keyword partial, so code generator fails
                    "");

            // Set Initial Solution State
            _MockSolution.Projects.Add(new MockProject
            {
                MockSourceFiles = new[] {_sourceFile}
            });

            _documentReader = buildMockOpenDocumentReader();

            //Simulate firing Document Open Event
            EventProxy.FireOnProjectItemOpened(this, new ProjectItemOpenedEventArgs
            {
                ClassFullPath = _sourceFile.FileName,
                DocumentReader = _documentReader,
                ProjectFullPath = _MockSolution.Projects[0].FileName
            });

            //Verify can generate code
            Assert.True(CanGenerateMixinCodeForSourceFile(_sourceFile),
                "Should be able to Generate Code at this point.  Does the _documentReader contain valid code like it should?");

            //Set Mock Expectations
            _documentReader.Expect(x => x.GetDocumentText()).Repeat.Never();

            _MockFileWrapper.Expect(x => x.ReadAllText(Arg.Is(_sourceFile.FileName)))
                .Repeat.Once();

               //Fire Document Closing Event
            EventProxy.FireOnProjectItemClosed(this, new ProjectItemClosedEventArgs
            {
                ClassFullPath = _sourceFile.FileName,
                ProjectFullPath = _MockSolution.Projects[0].FileName
            });
        }
        public override void MainSetup()
        {
            base.MainSetup();

            _sourceFile.Source =
                string.Format(
                    SourceCodeFormat,
                    //don't add the keyword partial, so code generator fails
                    "");

            // Set Initial Solution State
            _MockSolution.Projects.Add(new MockProject
            {
                MockSourceFiles = new[] { _sourceFile }
            });

            _documentReader = buildMockOpenDocumentReader();

            //Simulate firing Document Open Event
            EventProxy.FireOnProjectItemOpened(this, new ProjectItemOpenedEventArgs
            {
                ClassFullPath   = _sourceFile.FileName,
                DocumentReader  = _documentReader,
                ProjectFullPath = _MockSolution.Projects[0].FileName
            });

            //Verify can generate code
            Assert.True(CanGenerateMixinCodeForSourceFile(_sourceFile),
                        "Should be able to Generate Code at this point.  Does the _documentReader contain valid code like it should?");

            //Set Mock Expectations
            _documentReader.Expect(x => x.GetDocumentText()).Repeat.Never();

            _MockFileWrapper.Expect(x => x.ReadAllText(Arg.Is(_sourceFile.FileName)))
            .Repeat.Once();

            //Fire Document Closing Event
            EventProxy.FireOnProjectItemClosed(this, new ProjectItemClosedEventArgs
            {
                ClassFullPath   = _sourceFile.FileName,
                ProjectFullPath = _MockSolution.Projects[0].FileName
            });
        }
        public override void MainSetup()
        {
            base.MainSetup();

            _sourceFile.Source =
                string.Format(
                    SourceCodeFormat,
                    //don't add the keyword partial, so code generator fails
                    "");

            // Set Initial Solution State
            _MockSolution.Projects.Add(new MockProject
            {
                MockSourceFiles = new[] { _sourceFile }
            });

            _documentReader = buildMockOpenDocumentReader();

            //Verify can't generate code
            Assert.False(CanGenerateMixinCodeForSourceFile(_sourceFile),
                         "Should not be able to Generate Code at this point.  Does the _sourceFile contain an error like it should?");

            //Verify _documentReader has not been called.
            _documentReader.AssertWasNotCalled(x => x.GetDocumentText());

            //Make sure _MockFileWrapper is not called to read _sourceFile
            _MockFileWrapper.Expect(x => x.ReadAllText(Arg.Is(_sourceFile.FileName)))
            .Repeat.Never();

            //Simulate firing Document Open Event
            EventProxy.FireOnProjectItemOpened(this, new ProjectItemOpenedEventArgs
            {
                ClassFullPath   = _sourceFile.FileName,
                DocumentReader  = _documentReader,
                ProjectFullPath = _MockSolution.Projects[0].FileName
            });
        }
        public override void MainSetup()
        {
            base.MainSetup();

            _sourceFile.Source =
                string.Format(
                    SourceCodeFormat,
                    //don't add the keyword partial, so code generator fails
                    "");

            // Set Initial Solution State
            _MockSolution.Projects.Add(new MockProject
            {
                MockSourceFiles = new[] {_sourceFile}
            });

            _documentReader = buildMockOpenDocumentReader();

            //Verify can't generate code
            Assert.False(CanGenerateMixinCodeForSourceFile(_sourceFile),
                "Should not be able to Generate Code at this point.  Does the _sourceFile contain an error like it should?");

            //Verify _documentReader has not been called.
            _documentReader.AssertWasNotCalled(x => x.GetDocumentText());

            //Make sure _MockFileWrapper is not called to read _sourceFile
            _MockFileWrapper.Expect(x => x.ReadAllText(Arg.Is(_sourceFile.FileName)))
                .Repeat.Never();

            //Simulate firing Document Open Event
            EventProxy.FireOnProjectItemOpened(this, new ProjectItemOpenedEventArgs
            {
                ClassFullPath = _sourceFile.FileName,
                DocumentReader = _documentReader,
                ProjectFullPath = _MockSolution.Projects[0].FileName
            });
        }