예제 #1
0
        public static void TestBadConstructorArgument()
        {
            V2HmacHeaderBlock headerBlock = null;

            Assert.Throws <ArgumentNullException>(() => headerBlock = new V2HmacHeaderBlock(null));
            Assert.That(headerBlock, Is.Null);
        }
예제 #2
0
        public static void TestClone()
        {
            TypeMap.Register.Singleton <IRandomGenerator>(() => new FakeRandomGenerator());

            V2HmacHeaderBlock headerBlock = new V2HmacHeaderBlock();

            headerBlock.Hmac = new V2Hmac(Resolve.RandomGenerator.Generate(V2Hmac.RequiredLength));

            V2HmacHeaderBlock clone = (V2HmacHeaderBlock)headerBlock.Clone();

            Assert.That(clone.GetDataBlockBytes(), Is.EquivalentTo(headerBlock.GetDataBlockBytes()));
        }