コード例 #1
0
        public void HashCash_Validate_Should_Return_False_When_Nonce_Is_Invalid()
        {
            var hc   = new HashCash();
            var data = "test";

            var nonce = hc.GetNonce(data) - 1;

            Assert.False(hc.Validate(data, nonce));
        }
コード例 #2
0
        public void HashCash_GetNonce_Should_Return_Valid_Nonce()
        {
            var hc   = new HashCash();
            var data = "test";

            var nonce = hc.GetNonce(data);

            Assert.True(hc.Validate(data, nonce));
        }