public void FindTypeDerivedFrom_NoDerivedTypes_NullReturned() { // Act var type = SimplifyWebTypesFinder.FindTypeDerivedFrom <TestBootstrapper>(); // Assert Assert.IsNull(type); }
public void FindTypeDerivedFrom_BaseBootstrapper_TestBootstrapperReturned() { // Assign SimplifyWebTypesFinder.ExcludedAssembliesPrefixes.Remove("Simplify"); SimplifyWebTypesFinder.CleanLoadedTypesAndAssembliesInfo(); // Act var type = SimplifyWebTypesFinder.FindTypeDerivedFrom <BaseBootstrapper>(); // Assert Assert.AreEqual("Simplify.Web.Tests.TestEntities.TestBootstrapper", type !.FullName); }
/// <summary> /// Creates the bootstrapper. /// </summary> /// <returns></returns> public static BaseBootstrapper CreateBootstrapper() { var userBootstrapperType = SimplifyWebTypesFinder.FindTypeDerivedFrom <BaseBootstrapper>(); return(userBootstrapperType != null ? (BaseBootstrapper)Activator.CreateInstance(userBootstrapperType) : new BaseBootstrapper()); }