Пример #1
0
        public void LoadKeyThrowsFileNotFoundException()
        {
            string keyFile = Path.Combine(KeyDir, "unknown.snk");

            var    loader = new StrongNameKeyLoader();
            Action method = () => loader.LoadKey(keyFile);

            method.Should()
            .Throw <FileNotFoundException>();
        }
Пример #2
0
        public void LoadKeyThrowsInvalidKeyExceptionForPublicKey()
        {
            string keyFile = Path.Combine(KeyDir, "test_public_sha1.snk");

            var    loader = new StrongNameKeyLoader();
            Action method = () => loader.LoadKey(keyFile);

            method.Should()
            .Throw <InvalidKeyException>();
        }
Пример #3
0
        public void CanLoadKeyGeneratedBySn()
        {
            string keyFile = Path.Combine(KeyDir, "test.snk");

            var           loader = new StrongNameKeyLoader();
            StrongNameKey key    = loader.LoadKey(keyFile);

            key.SignatureSize.Should()
            .Be(1024 / 8);
        }