Example #1
0
        public static async Task CalculatePayload_WithBinaryContent_WillCalculateTheProperPayload()
        {
            // Arrange
            var testData  = await "POSTWithBinaryData".FromResourceV2();
            var mAuthCore = new MAuthCoreV2();
            var version   = MAuthVersion.MWSV2;
            // Act
            var result = await mAuthCore.CalculatePayload(testData.ToHttpRequestMessage(version), new PrivateKeyAuthenticationInfo()
            {
                ApplicationUuid = testData.ApplicationUuid,
                SignedTime      = testData.SignedTime,
                PrivateKey      = TestExtensions.ClientPrivateKey
            });

            // Assert
            Assert.Equal(testData.Payload, result);
        }
Example #2
0
        public async Task CalculatePayload_WithRequestAndAuthInfo_WillReturnCorrectPayload(string method)
        {
            // Arrange
            var testData = await method.FromResourceV2();

            var version   = MAuthVersion.MWSV2;
            var mAuthCore = new MAuthCoreV2();

            var authInfo = new PrivateKeyAuthenticationInfo()
            {
                ApplicationUuid = testData.ApplicationUuid,
                SignedTime      = testData.SignedTime,
                PrivateKey      = TestExtensions.ClientPrivateKey
            };

            // Act
            var result = await mAuthCore.CalculatePayload(testData.ToHttpRequestMessage(version), authInfo);

            // Assert
            Assert.Equal(testData.Payload, result);
        }