Пример #1
0
        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();
        }
Пример #2
0
        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
            }
        }