Esempio n. 1
0
        public void TestFromRawHandleFailsOnInvalid()
        {
            var invalidHandle = new BigNumberHandle();

            Assert.That(invalidHandle.IsInvalid);
            Assert.Throws <ArgumentException>(() => BigNumber.FromRawHandle(invalidHandle));
        }
Esempio n. 2
0
 public void TestFromRawHandle()
 {
     using (var handle = BigNumberHandle.Create())
     {
         BigNumberHandle.SetWord(handle, 3);
         var number = BigNumber.FromRawHandle(handle);
         Assert.That(BigNumberHandle.Compare(number.Handle, handle) == 0);
     }
 }
Esempio n. 3
0
        public void TestFromRawHandleFailsWithSecure()
        {
            var secureHandle = BigNumberHandle.CreateSecure();

            Assert.Throws <ArgumentException>(() => BigNumber.FromRawHandle(secureHandle));
        }