Example #1
0
        public void ExecuteConnect_WhenConnectSuccess_ShouldRaiseConnect()
        {
            var connectedParam = default(string);

            Mock.Arrange(() => _remoteApiOperator.Connect(Arg.AnyString)).Returns(Task.FromResult(true));
            _sut.Connected += s => connectedParam = s;

            _sut.ExecuteCommand("connect 127.0.0.1:11101");

            Assert.Equal("127.0.0.1:11101", connectedParam);
        }
Example #2
0
        public void Start_WhenCalled_ShouldExecuteCommandConnect()
        {
            _sut.Start();

            Mock.Assert(() => _connectParser.ExecuteCommand("connect 127.0.0.1:10000"), Occurs.Once());
        }