public void InitializeContext()
            {
                var uriService = Mock.Of <IUriReferenceService>(
                    u => u.ResolveUri <IInstanceBase>(It.IsAny <Uri>()) == Mock.Of <IProduct>(p =>
                                                                                              p.ToolkitInfo.Identifier == "ToolkitId"));

                this.store.TransactionManager.DoWithinTransaction(() =>
                {
                    var patternModel    = this.store.ElementFactory.CreateElement <PatternModelSchema>();
                    this.pattern        = patternModel.CreatePatternSchema() as PatternSchema;
                    pattern.PatternLink = "patternmanager://foo";
                });

                var globalExtension = new Mock <IExtensionPointSchema>();

                globalExtension.Setup(g => g.RequiredExtensionPointId).Returns("testExtensionPoint");
                this.allExtensionPoints = new[] { globalExtension.Object };

                this.descriptor = new ProvidedExtensionPointsPropertyDescriptor(
                    this.pattern,
                    allExtensionPoints,
                    new Mock <IUserMessageService>().Object,
                    "ImplementedExtensionPointsRaw",
                    string.Empty);

                this.descriptor.UriService = uriService;
            }
 public void InitializeContext()
 {
     this.store.TransactionManager.DoWithinTransaction(() =>
     {
         this.pattern = this.store.ElementFactory.CreateElement<PatternSchema>();
     });
 }
            public void InitializeContext()
            {
                var uriService = Mock.Of<IUriReferenceService>(
                    u => u.ResolveUri<IInstanceBase>(It.IsAny<Uri>()) == Mock.Of<IProduct>(p =>
                    p.ToolkitInfo.Identifier == "ToolkitId"));

                this.store.TransactionManager.DoWithinTransaction(() =>
                {
                    var patternModel = this.store.ElementFactory.CreateElement<PatternModelSchema>();
                    this.pattern = patternModel.CreatePatternSchema() as PatternSchema;
                    pattern.PatternLink = "patternmanager://foo";
                });

                var globalExtension = new Mock<IExtensionPointSchema>();
                globalExtension.Setup(g => g.RequiredExtensionPointId).Returns("testExtensionPoint");
                this.allExtensionPoints = new[] { globalExtension.Object };

                this.descriptor = new ProvidedExtensionPointsPropertyDescriptor(
                                this.pattern,
                                allExtensionPoints,
                                new Mock<IUserMessageService>().Object,
                                "ImplementedExtensionPointsRaw",
                                string.Empty);

                this.descriptor.UriService = uriService;
            }
 /// <summary>
 /// Initializes a new instance of the <see cref="ProvidedExtensionPointsPropertyDescriptor"/> class.
 /// </summary>
 /// <param name="patternSchema">The pattern.</param>
 /// <param name="allResolvedExtensionPoints">The extension points.</param>
 /// <param name="messageService">The message service.</param>
 /// <param name="propertyName">Name of the property.</param>
 /// <param name="value">The value.</param>
 /// <param name="attributes">The attributes.</param>
 public ProvidedExtensionPointsPropertyDescriptor(PatternSchema patternSchema, IEnumerable <IExtensionPointSchema> allResolvedExtensionPoints, IUserMessageService messageService, string propertyName, object value, params Attribute[] attributes)
     : base(propertyName, value, attributes)
 {
     this.patternSchema   = patternSchema;
     this.extensionPoints = allResolvedExtensionPoints;
     this.messageService  = messageService;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ProvidedExtensionPointsPropertyDescriptor"/> class.
 /// </summary>
 /// <param name="patternSchema">The pattern.</param>
 /// <param name="allResolvedExtensionPoints">The extension points.</param>
 /// <param name="messageService">The message service.</param>
 /// <param name="propertyName">Name of the property.</param>
 /// <param name="value">The value.</param>
 /// <param name="attributes">The attributes.</param>
 public ProvidedExtensionPointsPropertyDescriptor(PatternSchema patternSchema, IEnumerable<IExtensionPointSchema> allResolvedExtensionPoints, IUserMessageService messageService, string propertyName, object value, params Attribute[] attributes)
     : base(propertyName, value, attributes)
 {
     this.patternSchema = patternSchema;
     this.extensionPoints = allResolvedExtensionPoints;
     this.messageService = messageService;
 }
            public void InitializeContext()
            {
                var store = new DslTestStore<PatternModelDomainModel>().Store;

                store.TransactionManager.DoWithinTransaction(
                    () => this.product = (PatternSchema)store.ElementFactory.CreateElement<PatternModelSchema>().CreatePatternSchema());
            }
 public void InitializeContext()
 {
     this.store.TransactionManager.DoWithinTransaction(() =>
     {
         this.pattern = this.store.ElementFactory.CreateElement <PatternSchema>();
     });
 }
            public void InitializeContext()
            {
                var store = new DslTestStore <PatternModelDomainModel>();

                store.TransactionManager.DoWithinTransaction(
                    () => this.product = store.ElementFactory.CreateElement <PatternModelSchema>().Create <PatternSchema>());
            }
Beispiel #9
0
 public virtual void Initialize()
 {
     this.store.TransactionManager.DoWithinTransaction(() =>
     {
         this.pattern = this.store.ElementFactory.CreateElement <PatternSchema>();
     });
     validationContext = new ValidationContext(ValidationCategories.Save, this.pattern);
 }
 public virtual void Initialize()
 {
     this.store.TransactionManager.DoWithinTransaction(() =>
     {
         this.pattern = this.store.ElementFactory.CreateElement<PatternSchema>();
     });
     validationContext = new ValidationContext(ValidationCategories.Save, this.pattern);
 }
Beispiel #11
0
 public void InitializeContext()
 {
     this.store.TransactionManager.DoWithinTransaction(() =>
     {
         var patternModel = this.store.ElementFactory.CreateElement <PatternModelSchema>();
         this.product     = patternModel.Create <PatternSchema>();
         this.view        = this.product.Create <ViewSchema>();
     });
 }
 public void InitializeContext()
 {
     this.store.TransactionManager.DoWithinTransaction(() =>
     {
         var patternModel = this.store.ElementFactory.CreateElement<PatternModelSchema>();
         this.product = patternModel.Create<PatternSchema>();
         this.view = this.product.Create<ViewSchema>();
     });
 }
 public virtual void Initialize()
 {
     this.store.TransactionManager.DoWithinTransaction(() =>
     {
         this.elementOwner = this.store.ElementFactory.CreateElement <PatternSchema>();
         this.view         = this.store.ElementFactory.CreateElement <ViewSchema>();
         this.elementOwner.Views.Add(this.view);
     });
     validationContext = new ValidationContext(ValidationCategories.Save, this.view);
 }
 public virtual void Initialize()
 {
     this.store.TransactionManager.DoWithinTransaction(() =>
     {
         this.elementOwner = this.store.ElementFactory.CreateElement<PatternSchema>();
         this.view = this.store.ElementFactory.CreateElement<ViewSchema>();
         this.elementOwner.Views.Add(this.view);
     });
     validationContext = new ValidationContext(ValidationCategories.Save, this.view);
 }
            public void InitializeContext()
            {
                this.store.TransactionManager.DoWithinTransaction(() =>
                {
                    var patternModel  = store.ElementFactory.CreateElement <PatternModelSchema>();
                    this.product      = patternModel.Create <PatternSchema>();
                    this.product.Name = "WebService";
                });

                this.validationExtension = ExtensionElement.GetExtension <ValidationExtension>(this.product);
            }
Beispiel #16
0
 public void InitializeContext()
 {
     this.store.TransactionManager.DoWithinTransaction(() =>
     {
         var patternModel       = this.store.ElementFactory.CreateElement <PatternModelSchema>();
         this.product           = patternModel.Create <PatternSchema>();
         var automationSettings = this.product.Create <AutomationSettingsSchema>();
         this.settings          = automationSettings.AddExtension <TemplateSettings>();
     });
     validationContext = new ValidationContext(ValidationCategories.Save, this.settings);
 }
            public void WhenSameNamedElementAddedToDifferentOwner_ThenValidateNameIsUniqueSucceeds()
            {
                this.store.TransactionManager.DoWithinTransaction(() =>
                {
                    PatternSchema elementOwner2 = this.store.ElementFactory.CreateElement <PatternSchema>();
                    ViewSchema view2            = this.store.ElementFactory.CreateElement <ViewSchema>();
                    view2.Name = this.view.Name;
                    elementOwner2.Views.Add(view2);
                });
                this.view.ValidateNameIsUnique(validationContext);

                Assert.True(validationContext.CurrentViolations.Count == 0);
            }
            public void InitializeContext()
            {
                var serviceProvider = Mock.Get(this.store.ServiceProvider);

                serviceProvider.Setup(s => s.GetService(typeof(IPatternManager))).Returns(
                    Mock.Of <IPatternManager>(p => p.InstalledToolkits == new List <IInstalledToolkitInfo>()));

                ExtensionPointSchema extensionPoint1 = null;
                ExtensionPointSchema extensionPoint2 = null;

                this.store.TransactionManager.DoWithinTransaction(() =>
                {
                    var patternModel = this.store.ElementFactory.CreateElement <PatternModelSchema>();

                    var uriService = Mock.Of <IUriReferenceService>(
                        u => u.ResolveUri <IInstanceBase>(It.IsAny <Uri>()) == Mock.Of <IProduct>(p =>
                                                                                                  p.ToolkitInfo.Identifier == "ToolkitId"));

                    this.patternSchema             = patternModel.CreatePatternSchema() as PatternSchema;
                    this.patternSchema.PatternLink = "patternmanager://foo";
                    this.patternSchema.UriService  = uriService;

                    var view  = patternSchema.Create <ViewSchema>();
                    view.Name = "View1";

                    extensionPoint1      = view.Create <ExtensionPointSchema>();
                    extensionPoint1.Name = "ep1";

                    var prop1  = extensionPoint1.Create <PropertySchema>();
                    prop1.Name = "ContractProperty1";
                    prop1.Type = typeof(string).Name;

                    extensionPoint2      = view.Create <ExtensionPointSchema>();
                    extensionPoint2.Name = "ep2";

                    var prop2  = extensionPoint2.Create <PropertySchema>();
                    prop2.Name = "ContractProperty1";
                    prop2.Type = typeof(double).Name;
                });

                this.extensionPoints = new List <IExtensionPointSchema> {
                    extensionPoint1, extensionPoint2
                };

                this.descriptor = new ProvidedExtensionPointsPropertyDescriptor(
                    this.patternSchema,
                    extensionPoints,
                    new Mock <IUserMessageService>().Object,
                    "ImplementedExtensionPointsRaw",
                    string.Empty);
            }
            public void InitializeContext()
            {
                this.store.TransactionManager.DoWithinTransaction(() =>
                {
                    var patternModel       = this.store.ElementFactory.CreateElement <PatternModelSchema>();
                    this.product           = patternModel.Create <PatternSchema>();
                    var automationSettings = product.Create <AutomationSettingsSchema>();
                    this.settings          = automationSettings.AddExtension <CommandSettings>();
                });

                validationContext = new ValidationContext(ValidationCategories.Save, this.settings);

                this.validators = new CommandSettingsValidations(Mock.Of <INuPatternCompositionService>());
            }
            public void Initialize()
            {
                PatternSchema product = null;

                this.store = new Store(VsIdeTestHostContext.ServiceProvider,
                                       new Type[] { typeof(CoreDesignSurfaceDomainModel), typeof(PatternModelDomainModel), typeof(LibraryDomainModel) });

                this.store.TransactionManager.DoWithinTransaction(() =>
                {
                    var patternModel = this.store.ElementFactory.CreateElement <PatternModelSchema>();
                    product          = patternModel.Create <PatternSchema>();
                });

                this.validationExtension = product.GetExtensions <IValidationExtension>().FirstOrDefault();
                this.container           = product as IPatternElementSchema;
            }
            public void InitializeContext()
            {
                this.store.TransactionManager.DoWithinTransaction(() =>
                {
                    var patternModel = this.store.ElementFactory.CreateElement<PatternModelSchema>();
                    this.patternSchema = patternModel.CreatePatternSchema() as PatternSchema;
                });

                this.descriptor = new PatternSchemaTypeDescriptorProvider.PatternSchemaTypeDescriptor(this.patternSchema);

                var info = new Mock<IInstalledToolkitInfo>();
                var patternManager = new Mock<IPatternManager>();
                var componentModel = new Mock<IComponentModel>();
                var serviceProvider = Mock.Get(this.store.ServiceProvider);

                info.Setup(i => i.Schema.FindAll<IExtensionPointSchema>()).Returns(new[] { new Mock<IExtensionPointSchema>().Object });
                patternManager.Setup(m => m.InstalledToolkits).Returns(new[] { info.Object });
                componentModel.Setup(c => c.GetService<IPatternManager>()).Returns(patternManager.Object);
                componentModel.Setup(c => c.GetService<IUserMessageService>()).Returns(new Mock<IUserMessageService>().Object);
                serviceProvider.Setup(sp => sp.GetService(typeof(SComponentModel))).Returns(componentModel.Object);
            }
            public void InitializeContext()
            {
                this.store.TransactionManager.DoWithinTransaction(() =>
                {
                    var patternModel   = this.store.ElementFactory.CreateElement <PatternModelSchema>();
                    this.patternSchema = patternModel.CreatePatternSchema() as PatternSchema;
                });

                this.descriptor = new PatternSchemaTypeDescriptorProvider.PatternSchemaTypeDescriptor(this.patternSchema);

                var info            = new Mock <IInstalledToolkitInfo>();
                var patternManager  = new Mock <IPatternManager>();
                var componentModel  = new Mock <IComponentModel>();
                var serviceProvider = Mock.Get(this.store.ServiceProvider);

                info.Setup(i => i.Schema.FindAll <IExtensionPointSchema>()).Returns(new[] { new Mock <IExtensionPointSchema>().Object });
                patternManager.Setup(m => m.InstalledToolkits).Returns(new[] { info.Object });
                componentModel.Setup(c => c.GetService <IPatternManager>()).Returns(patternManager.Object);
                componentModel.Setup(c => c.GetService <IUserMessageService>()).Returns(new Mock <IUserMessageService>().Object);
                serviceProvider.Setup(sp => sp.GetService(typeof(SComponentModel))).Returns(componentModel.Object);
            }
            public void InitializeContext()
            {
                var type = typeof(ISolutionEvents);

                var store = new DslTestStore<PatternModelDomainModel>();

                store.TransactionManager.DoWithinTransaction(
                    () => this.product = store.ElementFactory.CreateElement<PatternModelSchema>().Create<PatternSchema>());
            }
            public void InitializeContext()
            {
                var serviceProvider = Mock.Get(this.store.ServiceProvider);
                serviceProvider.Setup(s => s.GetService(typeof(IPatternManager))).Returns(
                    Mock.Of<IPatternManager>(p => p.InstalledToolkits == new List<IInstalledToolkitInfo>()));

                ExtensionPointSchema extensionPoint1 = null;
                ExtensionPointSchema extensionPoint2 = null;
                this.store.TransactionManager.DoWithinTransaction(() =>
                {
                    var patternModel = this.store.ElementFactory.CreateElement<PatternModelSchema>();

                    var uriService = Mock.Of<IUriReferenceService>(
                        u => u.ResolveUri<IInstanceBase>(It.IsAny<Uri>()) == Mock.Of<IProduct>(p =>
                            p.ToolkitInfo.Identifier == "ToolkitId"));

                    this.patternSchema = patternModel.CreatePatternSchema() as PatternSchema;
                    this.patternSchema.PatternLink = "patternmanager://foo";
                    this.patternSchema.UriService = uriService;

                    var view = patternSchema.Create<ViewSchema>();
                    view.Name = "View1";

                    extensionPoint1 = view.Create<ExtensionPointSchema>();
                    extensionPoint1.Name = "ep1";

                    var prop1 = extensionPoint1.Create<PropertySchema>();
                    prop1.Name = "ContractProperty1";
                    prop1.Type = typeof(string).Name;

                    extensionPoint2 = view.Create<ExtensionPointSchema>();
                    extensionPoint2.Name = "ep2";

                    var prop2 = extensionPoint2.Create<PropertySchema>();
                    prop2.Name = "ContractProperty1";
                    prop2.Type = typeof(string).Name;
                });

                this.extensionPoints = new List<IExtensionPointSchema> { extensionPoint1, extensionPoint2 };

                this.descriptor = new ProvidedExtensionPointsPropertyDescriptor(
                                this.patternSchema,
                                extensionPoints,
                                new Mock<IUserMessageService>().Object,
                                "ImplementedExtensionPointsRaw",
                                string.Empty);
            }