public void Setup()
        {
            Behavior = new StoredViewModelAccessorBehavior <ChildVM>();

            Context = PropertyStub
                      .WithBehaviors(Behavior)
                      .GetContext();
        }
Exemple #2
0
        public void Setup()
        {
            var behavior = new TestBehavior(ValueStage.Value);

            VM      = ViewModelStub.WithBehaviors(behavior).Build();
            Manager = behavior.Manager;
            Context = new BehaviorContextStub(VM);
        }
Exemple #3
0
        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();
        }
Exemple #5
0
        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);
        }
Exemple #7
0
        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);
        }
Exemple #8
0
        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();
        }