public WCFConsoleServer(Process process, CurrentConsole currentConsole, int portNumber) { _process = process; _currentConsole = currentConsole; var binding = new NetTcpBinding(); var baseAddress = new Uri($"net.tcp://localhost:{portNumber}/MinecraftConsole"); _serviceHost = new ServiceHost(typeof(WCFConsoleServer), baseAddress); _serviceHost.AddServiceEndpoint(typeof(IWCFConsoleServer), binding, baseAddress); _serviceHost.Open(); }
internal void ActAndAssert(Action <Scenario> textToEnter, Action <string> console = null, Action <string[]> consoleMultiLine = null) { textToEnter(this); if (consoleMultiLine != null) { consoleMultiLine(CurrentConsole.Split(Environment.NewLine)); } else if (console != null) { console(CurrentConsole); } else { // no op } }