Пример #1
0
        public void PropertiesPartialExclusionsWithCalculation()
        {
            //Online HMAC tester: https://www.devglan.com/online-tools/hmac-sha256-online
            var expected = new SignatureCalculation(
                "9bac02d1fb108ec1581000627cf4b4edf99976761012a56a44d9bbb4829edba4",
                "Field3Ifalistenernodshisheadwhenyou'reexplainingyourprogram,wakehimup.Field42147483647Field5trueField6true"
                );
            var input      = new TestModelPartialExclusions();
            var calculator = new HMACSHA256SignatureCalculator();
            var sut        = new InstanceSignatureBuilder(calculator);
            var actual     = sut.Compute(input, knownKey);

            actual.Should().BeEquivalentTo(expected);
        }
Пример #2
0
        public void PropertiesImplicitlyIncludedInCalculation()
        {
            //Online HMAC tester: https://www.devglan.com/online-tools/hmac-sha256-online
            var expected = new SignatureCalculation(
                "8feda6b02259091f6d58b53f5bf5645586fe38694c43d50c4e06f51265ed84a9",
                "Field1Oneman'sconstantisanotherman'svariable.Field22147483647Field39223372036854775807Field43.4028235E+38Field51.7976931348623157E+308Field69999-12-31T23:59:59.9999999Field7true"
                );

            var input      = new TestModelInclusive();
            var calculator = new HMACSHA256SignatureCalculator();
            var sut        = new InstanceSignatureBuilder(calculator);
            var actual     = sut.Compute(input, knownKey);

            actual.Should().BeEquivalentTo(expected);
        }