Example #1
0
        public void CreateContextShouldCreateContextWithDefaultValuesFromVm()
        {
            var obj = new object();
            ValidatableViewModel viewModel = GetValidatableViewModel();
            IViewModel           vm        = viewModel;

            IValidatorContext validatorContext = viewModel.CreateContext(obj);

            validatorContext.ServiceProvider.ShouldEqual(vm.IocContainer);
            validatorContext.ValidationMetadata.ShouldEqual(viewModel.Settings.Metadata);
            validatorContext.PropertyMappings.ShouldEqual(viewModel.PropertyMappings);
            validatorContext.IgnoreProperties.ShouldEqual(viewModel.IgnoreProperties);
            validatorContext.Instance.ShouldEqual(obj);
            validatorContext.ServiceProvider.ShouldEqual(vm.IocContainer);
        }