public void CanRegisterFactory() { MockFactory factory = new MockFactory(); UIElementAdapterFactoryCatalog catalog = new UIElementAdapterFactoryCatalog(); catalog.RegisterFactory(factory); Assert.IsTrue(catalog.Factories.Contains(factory)); }
public void CanGetRegisteredFactory() { UIElementAdapterFactoryCatalog catalog = new UIElementAdapterFactoryCatalog(); MockFactory factory = new MockFactory(); catalog.RegisterFactory(factory); IUIElementAdapterFactory uiFactory = catalog.GetFactory("Foo"); Assert.AreSame(factory, uiFactory); }
public void GetFactoryWhenNoAppropriateFactoryRegisteredThrows() { UIElementAdapterFactoryCatalog catalog = new UIElementAdapterFactoryCatalog(); catalog.GetFactory(typeof(object)); }
public void RegisteringNullFactoryThrows() { UIElementAdapterFactoryCatalog catalog = new UIElementAdapterFactoryCatalog(); catalog.RegisterFactory(null); }