public void TestVoluntarioModelInjection() { IVoluntarioQuery voluntario = null; VoluntarioQueryIocManager iocManager = new VoluntarioQueryIocManager(base.Config); voluntario = iocManager.GetCurrentIVoluntarioQueryImplementation(); Assert.IsNotNull(voluntario); Assert.IsTrue(voluntario.GetType().IsClass); }
public IVoluntarioQuery GetCurrentImplementation() { IVoluntarioQuery obj = null; foreach (var type in typeof(IVoluntarioQuery).Assembly.DefinedTypes) { if (type.IsClass && type.FullName.EndsWith(_currentImplementation)) { obj = (IVoluntarioQuery)Assembly.Load(typeof(IVoluntarioQuery).Assembly.FullName).CreateInstance(type.FullName); break; } } return(obj); }