/// <summary> /// Initializes a new instance of the <see cref="ConsoleMio"/> class. /// Creates a new ConsoleMio helper with the default implementations of /// the <see cref="IConsoleWriter"/>, <see cref="IConsoleReader"/> and /// <see cref="IConsoleHombre"/> and invokes the <see cref="Setup"/> method /// </summary> public ConsoleMio() { this.writer = new ConsoleWriter(); this.reader = new ConsoleReader(); this.hombre = new ConsoleHombre(this.writer, this.reader); this.Setup(); }
/// <summary> /// Initializes a new instance of the <see cref="ConsoleMio"/> class. /// Creates a new ConsoleMio helper using the provided writer and reader /// and invokes the <see cref="Setup"/> method /// </summary> /// <param name="writer">An <see cref="IConsoleWriter"/> implementation</param> /// <param name="reader">An <see cref="IConsoleReader"/> implementation</param> /// <param name="hombre">An <see cref="IConsoleHombre"/> implementation</param> /// <exception cref="ArgumentNullException"> /// Throws an exception if some of the provided parameters is null /// </exception> public ConsoleMio(IConsoleWriter writer, IConsoleReader reader, IConsoleHombre hombre) { if (writer == null) { throw new ArgumentNullException(nameof(writer)); } if (reader == null) { throw new ArgumentNullException(nameof(reader)); } if (hombre == null) { throw new ArgumentNullException(nameof(hombre)); } this.reader = reader; this.writer = writer; this.hombre = hombre; }