public void Setup() { mockRepo = new MockRepository(MockBehavior.Loose); mockFileWrapper = mockRepo.Create<IFileWrapper>(); mockConsole= mockRepo.Create<System.IO.TextWriter>(); ISort sorter = new ArraySorter(); theProgram = new Program(mockFileWrapper.Object, sorter, mockConsole.Object); }
public static int Main(string[] args) { if (args.Length == 0) { outwriter.WriteLine(" Please provide filename to sort"); return 1; } IFileWrapper input = new StreamWrapper(args[0]); ISort sortImpl = new ArraySorter(); TextWriter output = Console.Out; Program app = new Program(input, sortImpl, output); return app.Main(); }