Esempio n. 1
0
        public void TestGetOutputHash()
        {
            AggregationHashChain       aggregationHashChain = GetAggregationHashChainFromFile(Resources.AggregationHashChain_Ok);
            AggregationHashChainResult result = new AggregationHashChainResult(1, aggregationHashChain.InputHash);

            result = aggregationHashChain.GetOutputHash(result);
            Assert.AreEqual(new DataHash(Base16.Decode("0116FF519501549E59F94952234BEAE90D1AB708901AF7B3F92B88B6A441969541")), result.Hash, "Unexpected output hash.");
            Assert.AreEqual(29, result.Level, "Unexpected level.");
        }
Esempio n. 2
0
        public void TestGetOutputHashWithoutResult()
        {
            AggregationHashChain aggregationHashChain = GetAggregationHashChainFromFile(Resources.AggregationHashChain_Ok);

            ArgumentNullException ex = Assert.Throws <ArgumentNullException>(delegate
            {
                aggregationHashChain.GetOutputHash(null);
            });

            Assert.AreEqual("result", ex.ParamName);
        }