public void CreateParamMgrPersister() { Type expectedType = typeof(RandomNetGenParamMgrPersister); RandomNetGenPersisterFactory fac = new RandomNetGenPersisterFactory(); IParamMgrPersister persister = fac.CreateParamMgrPersister(); Assert.NotNull(persister); Assert.IsType(expectedType, persister); }
public IPersisterFactory Create(ISimpleElement element) { IPersisterFactory persister = null; if (element is RandomGenerators.RandomNetworkGenElement) persister = new RandomGenerators.Persistance.RandomNetGenPersisterFactory(); else if (element is ImportNetworkElement) persister = new ImportNetworkPersisterFactory(); else if (element is ExportNetworkElement) persister = new ExportNetworkPersisterFactory(); return persister; }
public IPersisterFactory Create(Type elementType) { IPersisterFactory persister = null; if (elementType == typeof(RandomGenerators.RandomNetworkGenElement)) persister = new RandomGenerators.Persistance.RandomNetGenPersisterFactory(); else if (elementType == typeof(ImportNetworkElement)) persister = new ImportNetworkPersisterFactory(); else if (elementType == typeof(ExportNetworkElement)) persister = new ExportNetworkPersisterFactory(); return persister; }