public void Setup() { Behavior = new StoredViewModelAccessorBehavior <ChildVM>(); Context = PropertyStub .WithBehaviors(Behavior) .GetContext(); }
public void Setup() { var behavior = new TestBehavior(ValueStage.Value); VM = ViewModelStub.WithBehaviors(behavior).Build(); Manager = behavior.Manager; Context = new BehaviorContextStub(VM); }
private void SetupForProperty(ValueStage stage) { var behavior = new TestBehavior(stage); Property = PropertyStub.WithBehaviors(behavior).Of <object>(); VM = ViewModelStub.WithProperties(Property).Build(); Manager = behavior.Manager; Context = new BehaviorContextStub(VM); }
public void Setup() { SourceAccessor = new ValueAccessorStub <ChildSource>(); Behavior = new WrapperViewModelAccessorBehavior <ChildVM, ChildSource>(); Context = PropertyStub .WithBehaviors(Behavior, SourceAccessor, new ServiceLocatorValueFactoryBehavior <ChildVM>()) .GetContext(); }
public void Setup() { Behavior = new TestDescendantsValidationBehavior(ActionLogBuilder); var property = PropertyStub .WithBehaviors(Behavior, Next) .Of <string>(); Context = CreateBehaviorContextFor(property); }
public void Setup() { Behavior = new ViewModelPropertyDescendantsValidatorBehavior <ChildVM>(); ViewModelPropertyAccessor = new ValueAccessorStub <ChildVM>(); ViewModelPropertyAccessor.Value = new ChildVM(); var property = PropertyStub .WithBehaviors(Behavior, Next, ViewModelPropertyAccessor) .Of <string>(); Context = CreateBehaviorContextFor(property); }
public void Setup() { Behavior = new CollectionPropertyDescendantsValidatorBehavior <ViewModelStub>(); ViewModelPropertyAccessor = new ValueAccessorStub <IVMCollection <ViewModelStub> >(); ViewModelPropertyAccessor.Value = VMCollectionStub.Build(); var property = PropertyStub .WithBehaviors(Behavior, Next, ViewModelPropertyAccessor) .Of <string>(); Context = CreateBehaviorContextFor(property); }
public void CreateValue_UsesServiceLocator() { var valueToResolve = new TestObject(); var context = BehaviorContextStub.Build(); context.ServiceLocator = new ServiceLocatorStub() .Register <TestObject>(valueToResolve); var behavior = new ServiceLocatorValueFactoryBehavior <TestObject>(); var actualValue = behavior.CreateValue(context); Assert.AreEqual(valueToResolve, actualValue); }
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); }
protected void SetupFixture( ICollectionChangeHandlerBehavior <TItemVM> behavior, params IBehavior[] additionalBehaviors ) { Behavior = behavior; CollectionOwner = ViewModelStub .WithProperties(PropertyStub .WithBehaviors(behavior) .WithBehaviors(additionalBehaviors) .Build()) .Build(); Context = BehaviorContextStub .DecoratingContextOf(CollectionOwner) .Build(); }