public void GenerateSignatureAsync_GivenNoApiModel_ShouldThrowArgumentNullException()
        {
            var mockSigner = new Mock <ISigner>();
            var signerUt   = new DirectExecutionRequestApiModelSigner(mockSigner.Object);

            Func <Task> act = async() => await signerUt.GenerateSignatureAsync("Some key.", null);

            act.Should().Throw <ArgumentNullException>();
        }
        public async Task GenerateSignatureAsync_GivenDirectExecutionRequestApiModel_ShouldReturnSignature()
        {
            var mockSigner         = new Mock <ISigner>();
            var signerUt           = new DirectExecutionRequestApiModelSigner(mockSigner.Object);
            var testRsaKeyXml      = "Some key.";
            var testApiModel       = CreateTestApiModel();
            var testApiModelString = ToCanonicalString(testApiModel);
            var expectedSignature  = "It worked!";

            mockSigner.Setup(s => s.GenerateSignatureAsync(testRsaKeyXml, testApiModelString))
            .Returns(Task.FromResult(expectedSignature));

            var actualSignature = await signerUt.GenerateSignatureAsync(testRsaKeyXml, testApiModel);

            actualSignature.Should().Be(expectedSignature);
        }