Exemplo n.º 1
0
            public void InitializeContext()
            {
                var store = new DslTestStore <PatternModelDomainModel>();
                PatternModelSchema patternModel = null;

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

                var serviceProvider = Mock.Get(store.ServiceProvider);

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

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

                var patternSchema = patternModel.Create <PatternSchema>();

                patternSchema.Name        = "FooPattern";
                patternSchema.PatternLink = "patternmanager://foo";
                patternSchema.UriService  = uriService;

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

                store.TransactionManager.DoWithinTransaction(() =>
                {
                    this.extensionPoint = store.ElementFactory.CreateElement <ExtensionPointSchema>("ExtensionPoint1");
                    this.view.ExtensionPoints.Add(this.extensionPoint);
                });
            }
 public void InitializeContext()
 {
     this.store.TransactionManager.DoWithinTransaction(() =>
     {
         this.patternModel = this.store.ElementFactory.CreateElement<PatternModelSchema>();
         this.property = patternModel.Create<PatternSchema>().Create<PropertySchema>();
     });
 }
Exemplo n.º 3
0
 public void InitializeContext()
 {
     this.store.TransactionManager.DoWithinTransaction(() =>
     {
         this.patternModel = this.store.ElementFactory.CreateElement <PatternModelSchema>();
         this.property     = patternModel.Create <PatternSchema>().Create <PropertySchema>();
     });
 }