Beispiel #1
0
        public ICmac GetCmacInstance(CmacTypes cmacType)
        {
            switch (cmacType)
            {
            case CmacTypes.AES128:
            case CmacTypes.AES192:
            case CmacTypes.AES256:
                return(new CmacAes(_engineFactory, _modeFactory));

            case CmacTypes.TDES:
                return(new CmacTdes(_engineFactory, _modeFactory));
            }

            throw new ArgumentException($"Invalid {cmacType}");
        }
        public void ShouldReturnProperCmacInstance(CmacTypes cmacType, Type expectedType)
        {
            var result = _subject.GetCmacInstance(cmacType);

            Assert.IsInstanceOf(expectedType, result);
        }