public void ConvertFrom() { ResourceManagerConverter cvt = new ResourceManagerConverter(); object actual = cvt.ConvertFrom("Spring.TestResource.txt, Spring.Core.Tests"); Assert.IsNotNull(actual); Assert.AreEqual(typeof(ResourceManager), actual.GetType()); }
public void ConvertFrom () { ResourceManagerConverter cvt = new ResourceManagerConverter(); object actual = cvt.ConvertFrom ("Spring.TestResource.txt, Spring.Core.Tests"); Assert.IsNotNull (actual); Assert.AreEqual (typeof (ResourceManager), actual.GetType()); }
public void ConvertFromOnlyResourceName() { ResourceManagerConverter cvt = new ResourceManagerConverter(); object foo = cvt.ConvertFrom("Spring.TestResource.txt,"); }
public void ConvertFromSingleString() { ResourceManagerConverter cvt = new ResourceManagerConverter(); Assert.Throws <ArgumentException>(() => cvt.ConvertFrom("Spring.TestResource.txt")); }
public void ConvertFromBadAssembly() { ResourceManagerConverter cvt = new ResourceManagerConverter(); Assert.Throws <ArgumentException>(() => cvt.ConvertFrom("Spring.TestResource.txt, FooAssembly")); }
/// <summary> /// Invoked by an <see cref="Spring.Objects.Factory.IObjectFactory"/> /// after it has set all object properties supplied. /// </summary> /// <remarks> /// <p> /// The list may contain objects of type <see cref="System.String"/> or /// <see cref="System.Resources.ResourceManager"/>. <see cref="System.String"/> types /// are converted to <see cref="System.Resources.ResourceManager"/> instances using the notation /// resourcename, assembly partial name. /// </p> /// </remarks> /// <exception cref="System.ArgumentException"> /// If the conversion from a <see cref="System.String"/> to a /// <see cref="System.Resources.ResourceManager"/> can't be performed. /// </exception> public void AfterPropertiesSet() { ResourceManagerConverter cvt = new ResourceManagerConverter(); for (int i = 0; i < _resourceManagers.Count; i++) { object o = _resourceManagers[i]; if (o is String) { _resourceManagers[i] = cvt.ConvertFrom((string) o); } else if (!(o is ResourceManager)) { throw new ArgumentException("Only Types of string and ResourceManager are allowed. Type " + o.GetType() + " was set instead."); } } }
public void ConvertFromSingleComma () { ResourceManagerConverter cvt = new ResourceManagerConverter(); Assert.Throws<ArgumentException>(() => cvt.ConvertFrom (",")); }
public void ConvertFromNullReference () { ResourceManagerConverter cvt = new ResourceManagerConverter(); Assert.Throws<NotSupportedException>(() => cvt.ConvertFrom (null)); }
public void ConvertFromOnlyAssemblyNAme () { ResourceManagerConverter cvt = new ResourceManagerConverter(); object foo = cvt.ConvertFrom (",Spring.Core.Tests"); }
public void ConvertFromSingleComma() { ResourceManagerConverter cvt = new ResourceManagerConverter(); object foo = cvt.ConvertFrom(","); }
public void ConvertFromSingleString() { ResourceManagerConverter cvt = new ResourceManagerConverter(); object foo = cvt.ConvertFrom("Spring.TestResource.txt"); }
public void ConvertFromNullReference() { ResourceManagerConverter cvt = new ResourceManagerConverter(); object foo = cvt.ConvertFrom(null); }
public void ConvertFromBad_App_GlobalResources() { ResourceManagerConverter cvt = new ResourceManagerConverter(); object foo = cvt.ConvertFrom("Spring.TestResource.txt, " + ResourceManagerConverter.APP_GLOBALRESOURCES_ASSEMBLYNAME); }
public void ConvertFromBadAssembly() { ResourceManagerConverter cvt = new ResourceManagerConverter(); object foo = cvt.ConvertFrom("Spring.TestResource.txt, FooAssembly"); }
public void ConvertFromBad_App_GlobalResources() { ResourceManagerConverter cvt = new ResourceManagerConverter(); Assert.Throws<ArgumentException>(() => cvt.ConvertFrom("Spring.TestResource.txt, "+ResourceManagerConverter.APP_GLOBALRESOURCES_ASSEMBLYNAME)); }
public void ConvertFromOnlyResourceName() { ResourceManagerConverter cvt = new ResourceManagerConverter(); object foo = cvt.ConvertFrom ("Spring.TestResource.txt,"); }
public void ConvertFromBadAssembly() { ResourceManagerConverter cvt = new ResourceManagerConverter(); object foo = cvt.ConvertFrom ("Spring.TestResource.txt, FooAssembly"); }
public void ConvertFromSingleString () { ResourceManagerConverter cvt = new ResourceManagerConverter(); Assert.Throws<ArgumentException>(() => cvt.ConvertFrom ("Spring.TestResource.txt")); }
public void ConvertFromBad_App_GlobalResources() { ResourceManagerConverter cvt = new ResourceManagerConverter(); object foo = cvt.ConvertFrom("Spring.TestResource.txt, "+ResourceManagerConverter.APP_GLOBALRESOURCES_ASSEMBLYNAME); }
public void ConvertFromOnlyAssemblyNAme () { ResourceManagerConverter cvt = new ResourceManagerConverter(); Assert.Throws<ArgumentException>(() => cvt.ConvertFrom (",Spring.Core.Tests")); }
public void ConvertFromNullReference () { ResourceManagerConverter cvt = new ResourceManagerConverter(); object foo = cvt.ConvertFrom (null); }
public void ConvertFromOnlyAssemblyNAme() { ResourceManagerConverter cvt = new ResourceManagerConverter(); Assert.Throws <ArgumentException>(() => cvt.ConvertFrom(",Spring.Core.Tests")); }
public void ConvertFromSingleString () { ResourceManagerConverter cvt = new ResourceManagerConverter(); object foo = cvt.ConvertFrom ("Spring.TestResource.txt"); }
public void ConvertFromBad_App_GlobalResources() { ResourceManagerConverter cvt = new ResourceManagerConverter(); Assert.Throws <ArgumentException>(() => cvt.ConvertFrom("Spring.TestResource.txt, " + ResourceManagerConverter.APP_GLOBALRESOURCES_ASSEMBLYNAME)); }
public void ConvertFromSingleComma () { ResourceManagerConverter cvt = new ResourceManagerConverter(); object foo = cvt.ConvertFrom (","); }
public void ConvertFromNullReference() { ResourceManagerConverter cvt = new ResourceManagerConverter(); Assert.Throws <NotSupportedException>(() => cvt.ConvertFrom(null)); }
public void ConvertFromBadAssembly() { ResourceManagerConverter cvt = new ResourceManagerConverter(); Assert.Throws<ArgumentException>(() => cvt.ConvertFrom ("Spring.TestResource.txt, FooAssembly")); }
public void ConvertFromSingleComma() { ResourceManagerConverter cvt = new ResourceManagerConverter(); Assert.Throws <ArgumentException>(() => cvt.ConvertFrom(",")); }
public void ConvertFromOnlyAssemblyNAme() { ResourceManagerConverter cvt = new ResourceManagerConverter(); object foo = cvt.ConvertFrom(",Spring.Core.Tests"); }