public void Dispose()
 {
     mContext = null;
     mValidator = null;
     mReportWriterFactory = null;
     mFileNameGenerator = null;
     mResourceCopier = null;
     mStreamFactory = null;
     mHtmlIndexFileWriter = null;
     mTotalValidatorValidateUrlCalls = 0;
 }
        public void Init()
        {
            mContext = new Mock<IRunnerContext>();
            mValidator = new Mock<IValidatorWrapper>();
            mReportWriterFactory = new Mock<IValidatorReportWriterFactory>();
            mFileNameGenerator = new Mock<IFileNameGenerator>();
            mResourceCopier = new MockResourceCopier();
            mStreamFactory = new Mock<IStreamFactory>();
            mHtmlIndexFileWriter = new Mock<IHtmlIndexFileWriter>();

            //mContext
            //    .Setup(x => x.ValidatorUrl)
            //    .Returns("http://www.whereever.com/validator");
            mContext
                .Setup(x => x.Announcer)
                .Returns(new Mock<IAnnouncer>().Object);
            mContext
                .Setup(x => x.TotalTimeStopwatch)
                .Returns(new Mock<Stopwatch>().Object);

            mValidator
                .Setup(x => x.IsDefaultValidatorUrl())
                .Returns(false);

            mValidator
                .Setup(x => x.ValidateUrl(It.IsAny<string>(), It.IsAny<Stream>(), It.IsAny<OutputFormat>()))
                .Returns(new Mock<IValidatorReportItem>().Object);

            mReportWriterFactory
                .Setup(x => x.GetTextWriter(It.IsAny<Stream>(), It.IsAny<Encoding>()))
                .Returns((Stream x, Encoding y) => (IValidatorReportTextWriter)new Mock<IValidatorReportTextWriter>().Object);

            mFileNameGenerator
                .Setup(x => x.GenerateFileName(It.IsAny<string>(), It.IsAny<string>()))
                .Returns("hello.html");

            mStreamFactory
                .Setup(x => x.GetMemoryStream())
                .Returns(new MemoryStream());

            mStreamFactory
                .Setup(x => x.GetFileStream(It.IsAny<string>(), It.IsAny<FileMode>(), It.IsAny<FileAccess>()))
                .Returns(new MemoryStream());
        }