コード例 #1
0
        public void adds_the_source()
        {
            var theSource = MockRepository.GenerateStub <IValidationSource>();

            theGraph.RegisterSource(theSource);
            theGraph.Sources.ShouldContain(theSource);
        }
コード例 #2
0
        public void SetUp()
        {
            theModel = new ContactModel();
            theType  = theModel.GetType();

            r1 = MockRepository.GenerateStub <IValidationRule>();
            r2 = MockRepository.GenerateStub <IValidationRule>();
            r3 = MockRepository.GenerateStub <IValidationRule>();

            theMatchingSource = ConfiguredValidationSource.For(type => type == theType, r1, r2);
            theOtherSource    = ConfiguredValidationSource.For(type => type == typeof(int), r3);

            theGraph = ValidationGraph.BasicGraph();
            theGraph.RegisterSource(theMatchingSource);
            theGraph.RegisterSource(theOtherSource);

            theContext = ValidationContext.For(theModel);

            thePlan = ValidationPlan.For(theType, theGraph);
        }
コード例 #3
0
        public void SetUp()
        {
            theModel = new ContactModel();
            theType = theModel.GetType();

            r1 = MockRepository.GenerateStub<IValidationRule>();
            r2 = MockRepository.GenerateStub<IValidationRule>();
            r3 = MockRepository.GenerateStub<IValidationRule>();

            theMatchingSource = ConfiguredValidationSource.For(type => type == theType, r1, r2);
            theOtherSource = ConfiguredValidationSource.For(type => type == typeof(int), r3);

            theGraph = ValidationGraph.BasicGraph();
            theGraph.RegisterSource(theMatchingSource);
            theGraph.RegisterSource(theOtherSource);

            theContext = ValidationContext.For(theModel);

            thePlan = ValidationPlan.For(theType, theGraph);
        }