Exemplo n.º 1
0
        public void EncodeAndDecodeStringType()
        {
            var helper       = new TypeSignatureHelper();
            var expectedType = typeof(string);

            var signature  = helper.GetSignatureFromType(expectedType);
            var actualType = helper.GetTypeFromSignature(signature);

            Assert.IsNotNull(actualType);
            Assert.AreEqual(expectedType, actualType);
        }
Exemplo n.º 2
0
        public void GetTypeFromSignature_MissingClosingGenericFails()
        {
            var helper = new TypeSignatureHelper();

            Assert.Throws <SignatureInvalidException>(() => helper.GetTypeFromSignature("{System.Type<{System.Type, mscorlib}"));
        }
Exemplo n.º 3
0
        public void GetTypeFromSignature_PartialStringFails()
        {
            var helper = new TypeSignatureHelper();

            Assert.Throws <SignatureInvalidException>(() => helper.GetTypeFromSignature("{System.Type"));
        }
Exemplo n.º 4
0
        public void GetTypeFromSignature_EmptyStringFails()
        {
            var helper = new TypeSignatureHelper();

            Assert.Throws <SignatureInvalidException>(() => helper.GetTypeFromSignature(""));
        }
Exemplo n.º 5
0
        public void GetTypeFromSignature_MissingTypeFails()
        {
            var helper = new TypeSignatureHelper();

            Assert.Throws <TypeNotFoundException>(() => helper.GetTypeFromSignature("{Some.Bogus.Type, mscorlib}"));
        }