public void GetMempoolResponse_Can_Get_Output()
        {
            //Arrange
            var getMempoolResponse = new GetMempoolResponse();
            var commandContext     = TestCommandHelpers.GenerateCliResponseCommandContext(_testScheduler);
            var getMempoolCommand  = new GetMempoolCommand(commandContext, Substitute.For <ILogger>());

            //Act
            TestCommandHelpers.GenerateResponse(commandContext, getMempoolResponse);

            _testScheduler.Start();

            //Assert
            commandContext.UserOutput.Received(1).WriteLine(getMempoolResponse.ToJsonString());
        }
Beispiel #2
0
        public void GetMempoolRequest_Can_Be_Sent()
        {
            //Arrange
            var commandContext = TestCommandHelpers.GenerateCliRequestCommandContext();
            var connectedNode  = commandContext.GetConnectedNode(null);
            var command        = new GetMempoolCommand(commandContext, Substitute.For <ILogger>());

            //Act
            TestCommandHelpers.GenerateRequest(commandContext, command, "-n", "node1");

            //Assert
            var requestSent = TestCommandHelpers.GetRequest <GetMempoolRequest>(connectedNode);

            requestSent.Should().BeOfType(typeof(GetMempoolRequest));
        }