public void Setup() { ValidationResult = CreateValidationResult("Error"); Behavior = new TestValidationSourceBehavior(ValidationStep.Value); Property = PropertyStub.WithBehaviors(Behavior).Of <string>(); Executor = new ValidationExecutorStub(); var vm = ViewModelStub .WithProperties(Property) .WithBehaviors(Executor) .Build(); Context = new BehaviorContextStub(vm); }
public ItemInCollectionSetup(StringBuilder log) { ItemExecutor = new ValidationExecutorStub(); CollectionOwnerExecutor = new ValidationExecutorStub(); ItemProperty = PropertyStub .WithBehaviors(new RevalidationBehaviorSpy(log)) .Build(); Item = ViewModelStub .WithBehaviors(ItemExecutor, new RevalidationBehaviorSpy(log)) .WithProperties(ItemProperty) .Build(); var collectionOwner = ViewModelStub .WithBehaviors(CollectionOwnerExecutor) .Build(); Collection = VMCollectionStub .WithItems(Item) .WithOwner(collectionOwner) .Build(); }