public void VerifyMessageResponse_Can_Get_Output() { //Arrange var verifyMessageResponse = new VerifyMessageResponse(); var commandContext = TestCommandHelpers.GenerateCliResponseCommandContext(_testScheduler); var messageVerifyCommand = new MessageVerifyCommand(commandContext, Substitute.For <ILogger>()); //Act TestCommandHelpers.GenerateResponse(commandContext, verifyMessageResponse); _testScheduler.Start(); //Assert commandContext.UserOutput.Received(1).WriteLine(verifyMessageResponse.ToJsonString()); }
public void VerifyMessageRequest_Can_Be_Sent() { //Arrange var commandContext = TestCommandHelpers.GenerateCliRequestCommandContext(); var connectedNode = commandContext.GetConnectedNode(null); var command = new MessageVerifyCommand(commandContext, Substitute.For<ILogger>()); //Act TestCommandHelpers.GenerateRequest(commandContext, command, "-n", "node1", "-m", "hello world", "-p", "public key", "-s", "signature"); //Assert var requestSent = TestCommandHelpers.GetRequest<VerifyMessageRequest>(connectedNode); requestSent.Should().BeOfType(typeof(VerifyMessageRequest)); }