Esempio n. 1
0
        public void GetPeerBlackListingResponse_Can_Get_Output()
        {
            //Arrange
            var setPeerBlackListRequest    = new SetPeerBlacklistResponse();
            var commandContext             = TestCommandHelpers.GenerateCliResponseCommandContext(_testScheduler);
            var getPeerBlackListingCommand = new PeerBlackListingCommand(commandContext, Substitute.For <ILogger>());

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

            _testScheduler.Start();

            //Assert
            commandContext.UserOutput.Received(1).WriteLine(setPeerBlackListRequest.ToJsonString());
        }
Esempio n. 2
0
        public void GetPeerBlackListingRequest_Can_Be_Sent()
        {
            //Arrange
            var commandContext = TestCommandHelpers.GenerateCliRequestCommandContext();
            var connectedNode  = commandContext.GetConnectedNode(null);
            var command        = new PeerBlackListingCommand(commandContext, Substitute.For <ILogger>());

            //Act
            TestCommandHelpers.GenerateRequest(commandContext, command, "-n", "node1", "-b", "true", "-i", "10.1.1.1",
                                               "-p", "public key");

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

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