public virtual void Initialize()
 {
     this.store.TransactionManager.DoWithinTransaction(() =>
     {
         this.tool = this.store.ElementFactory.CreateElement <ProductionTool>();
     });
 }
Exemple #2
0
 public virtual void Initialize()
 {
     this.store.TransactionManager.DoWithinTransaction(() =>
     {
         this.tool = this.store.ElementFactory.CreateElement <ProductionTool>();
     });
     validationContext = new ValidationContext(ValidationCategories.Save, this.tool);
 }
Exemple #3
0
            public void WhenSameNamedElementAddedToDesign_ThenValidateNameIsUniqueFails()
            {
                this.store.TransactionManager.DoWithinTransaction(() =>
                {
                    ProductionTool tool2 = this.store.ElementFactory.CreateElement <ProductionTool>();
                    tool2.Name           = this.tool.Name;
                });
                this.tool.ValidateNameIsUnique(validationContext);

                Assert.True(validationContext.CurrentViolations.Count == 1);
                Assert.True(validationContext.ValidationSubjects.IndexOf(this.tool) == 0);
            }