Exemplo n.º 1
0
        public void SymmetricAlgorithmName_SetThrows_IfValueIsNullOrEmpty()
        {
            using CMAC cmac = new TestCMAC();

            Assert.Throws <ArgumentException>(() => cmac.SymmetricAlgorithmName = null !);
            Assert.Throws <ArgumentException>(() => cmac.SymmetricAlgorithmName = string.Empty);
            Assert.Null(cmac.SymmetricAlgorithmName);
        }
Exemplo n.º 2
0
        public void SymmetricAlgorithmName_SetThrows_IfValueIsInvalid()
        {
            using CMAC cmac = new TestCMAC();
            const string unknownAlgorithmName = "No known algorithm name has spaces, so this better be invalid...";

            Assert.Throws <CryptographicException>(() => cmac.SymmetricAlgorithmName = unknownAlgorithmName);
            Assert.Null(cmac.SymmetricAlgorithmName);
        }
Exemplo n.º 3
0
 public void SetNullOrEmptyAlgorithmName()
 {
     using (CMAC cmac = new TestCMAC())
     {
         Assert.Throws <ArgumentException>(() => cmac.SymmetricAlgorithmName = null);
         Assert.Throws <ArgumentException>(() => cmac.SymmetricAlgorithmName = string.Empty);
         Assert.Equal(null, cmac.SymmetricAlgorithmName);
     }
 }
Exemplo n.º 4
0
        public void SetUnknownAlgorithmName()
        {
            using (CMAC cmac = new TestCMAC())
            {
                const string UnknownAlgorithmName = "No known algorithm name has spaces, so this better be invalid...";

                Assert.Throws <CryptographicException>(() => cmac.SymmetricAlgorithmName = UnknownAlgorithmName);
                Assert.Equal(null, cmac.SymmetricAlgorithmName);
            }
        }