public virtual void Initialize() { this.store.TransactionManager.DoWithinTransaction(() => { this.tool = this.store.ElementFactory.CreateElement <ProductionTool>(); }); }
public virtual void Initialize() { this.store.TransactionManager.DoWithinTransaction(() => { this.tool = this.store.ElementFactory.CreateElement <ProductionTool>(); }); validationContext = new ValidationContext(ValidationCategories.Save, this.tool); }
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); }