Exemplo n.º 1
0
        /// <summary>
        /// Validates the dataset.
        /// </summary>
        private void ValidateDataset()
        {
            var mapperFactory = new TargetMapperFactory(DataContextObject.SelectedDataType.Target);

            DataContextObject.Mapper = mapperFactory.CreateMapper(DataContextObject.CurrentCrosswalk);
            var type = Type.GetType(DataContextObject.SelectedDataType.Target.ClrType);

            ValidationEngine = new InstanceValidator(type);
            ApplyNullResults();
            RunValidation();
        }
        public void TestTargetMapperFactory()
        {
            var type   = typeof(FooTarget);
            var target = DummyTarget;

            target.ClrType = type.AssemblyQualifiedName;
            var factory = new TargetMapperFactory(target);
            var mapper  = factory.CreateMapper(Enumerable.Empty <MappedFieldEntryViewModel>());

            mapper["SomeEnum"] = Something.value2;
            var value = mapper.Target.SomeEnum;

            Assert.AreEqual(value, Something.value2);
        }