public void Initialize() { tester = new TesterIOConsole(); reporter = new ReporterSuggestedPackages(tester.Mock(AbstractTester.OptionStdErrorSeparately(true))); repositoryInstalled = new Mock <IRepositoryInstalled>(); package = new Mock <IPackage>(); package.Setup((o) => o.GetNamePretty()).Returns("foo"); }
public void Initialize() { repository = new Mock <IRepositoryInstalled>(); tester = new TesterIOConsole(); io = tester.Mock(AbstractTester.OptionStdErrorSeparately(true)); installer = new InstallerMetaPackage(io); package = new Mock <IPackage>(); package.Setup((o) => o.Clone()).Returns(package.Object); }
public void Initialize() { bucket = new Bucket(); tester = new TesterIOConsole(); eventArgs = new Mock <EventArgs>(); fileSystem = new Mock <IFileSystem>(); process = new Mock <IProcessExecutor>(); io = tester.Mock( AbstractTester.OptionVerbosity(OutputOptions.VerbosityVeryVerbose), AbstractTester.OptionStdErrorSeparately(true)); dispatcher = new BEventDispatcher(bucket, io, process.Object, fileSystem.Object); package = new Mock <IPackageRoot>(); config = new Config(); bucket.SetPackage(package.Object); bucket.SetConfig(config); }
public void TestTesterIOConsoleMock() { var tester = new TesterIOConsole(); tester.SetInputs(new[] { "menghanyu" }); var io = tester.Mock(AbstractTester.OptionStdErrorSeparately(true)); Assert.AreEqual("menghanyu", (string)io.Ask("what's your name?", "miaomiao")); io.Write("hello world"); Assert.AreEqual( @"hello world ", tester.GetDisplay()); io.WriteError("hello world error"); Assert.AreEqual( @"what's your name?hello world error ", tester.GetDisplayError()); }