GetNewIv() public method

Returns a new non-zero 4-byte IV array.
public GetNewIv ( ) : byte[]
return byte[]
コード例 #1
0
        public void GetNewIv_Should_Call_GetNonZeroBytes_Once()
        {
            var rngMock   = new Mock <RandomNumberGenerator>(MockBehavior.Loose);
            var generator = new IvGenerator(rngMock.Object);

            generator.GetNewIv();

            rngMock.Verify(rng => rng.GetNonZeroBytes(ZeroByteArrayWithLength4()), Times.Once());
        }
コード例 #2
0
        public void GetNewIv_Should_Call_GetNonZeroBytes_Once()
        {
            var rngMock = new Mock<RandomNumberGenerator>(MockBehavior.Loose);
            var generator = new IvGenerator(rngMock.Object);

            generator.GetNewIv();

            rngMock.Verify(rng => rng.GetNonZeroBytes(ZeroByteArrayWithLength4()), Times.Once());
        }