public void WhenCreatingAnPatternElementSchema_ThenInjectsExtensionElements() { ElementSchema element = null; this.store.TransactionManager.DoWithinTransaction(() => { element = this.store.ElementFactory.CreateElement <ElementSchema>(); }); Assert.True(element.GetExtensions <IGuidanceExtension>().Any()); Assert.True(element.GetExtensions <IArtifactExtension>().Any()); }
public void Initialize() { ElementSchema element = null; this.store = new Store(VsIdeTestHostContext.ServiceProvider, new[] { typeof(CoreDesignSurfaceDomainModel), typeof(PatternModelDomainModel), typeof(LibraryDomainModel) }); this.store.TransactionManager.DoWithinTransaction(() => { this.store.ElementFactory.CreateElement <PatternModelSchema>(); element = this.store.ElementFactory.CreateElement <ElementSchema>(); }); this.guidanceExtension = element.GetExtensions <IGuidanceExtension>().FirstOrDefault(); this.container = element as IPatternElementSchema; }