Esempio n. 1
0
        public void ResolveType()
        {
            const string typeName = "Remotion.UnitTests.ServiceLocation.TypeNameTemplateResolverTest, Remotion.UnitTests, Version = <version>";
            var          result   = TypeNameTemplateResolver.ResolveToType(typeName, typeof(TypeNameTemplateResolverTest).Assembly);

            Assert.That(result, Is.SameAs(typeof(TypeNameTemplateResolverTest)));
        }
Esempio n. 2
0
        private static TryGetDisplayName GetLocalizedNameFunc()
        {
#pragma warning disable 618
            var serviceType = TypeNameTemplateResolver.ResolveToType(
                "Remotion.Globalization.ExtensibleEnums.IExtensibleEnumGlobalizationService, Remotion.Globalization.ExtensibleEnums, Version=<version>, Culture=neutral, PublicKeyToken=<publicKeyToken>",
                typeof(ExtensibleEnumExtensions).Assembly);
#pragma warning restore 618
            var method = serviceType.GetMethod("TryGetExtensibleEnumValueDisplayName");
            Assertion.IsNotNull(method, "IExtensibleEnumGlobalizationService does not contain method 'GetExtensibleEnumValueDisplayName'.");

            var service = SafeServiceLocator.Current.GetInstance(serviceType);

            return((TryGetDisplayName)method.CreateDelegate(typeof(TryGetDisplayName), service));
        }
Esempio n. 3
0
 public void ResolveType_WithInvalidTypeName()
 {
     TypeNameTemplateResolver.ResolveToType("Badabing", typeof(TypeNameTemplateResolverTest).Assembly);
 }