Beispiel #1
0
        public void Clear_ShouldClearState()
        {
            var state = new SpongeState(BitString.Random(new Random(), 48), 24);

            Assert.IsTrue(state.BitString.Any(b => b));
            state.Clear();
            Assert.IsFalse(state.BitString.Any(b => b));
        }
Beispiel #2
0
        public void Random_ShouldReturnDistinctBitstrings()
        {
            var random = new Random();
            var b1     = BitString.Random(random, 42);
            var b2     = BitString.Random(random, 42);

            Assert.AreNotEqual(b1, b2);
        }
Beispiel #3
0
        public void Constructor_SpongeState_ShouldCopy()
        {
            var state = new SpongeState(BitString.Random(new Random(), 100), 72);
            var copy  = new SpongeState(state);

            Assert.AreNotSame(state, copy);
            Assert.AreNotSame(state.BitString, copy.BitString);
            Assert.AreEqual(state.BitString, copy.BitString);
        }