public void GivenDefinition_ValidatePageTypeDefinitions_CallsValidatorsValidatePageTypeDefinitionsMethod()
        {
            List <PageTypeDefinition>   definitions         = new List <PageTypeDefinition>();
            PageTypeSynchronizer        synchronizer        = CreateSynchronizer();
            MockRepository              fakes               = new MockRepository();
            PageTypeDefinitionValidator definitionValidator = fakes.Stub <PageTypeDefinitionValidator>((PageDefinitionTypeMapper)null);

            definitionValidator.Stub(validator => validator.ValidatePageTypeDefinitions(definitions));
            definitionValidator.Replay();
            synchronizer.PageTypeDefinitionValidator = definitionValidator;

            synchronizer.ValidatePageTypeDefinitions(definitions);

            definitionValidator.AssertWasCalled(validator => validator.ValidatePageTypeDefinitions(definitions));
        }
Example #2
0
        public void GivenListOfPageTypeDefinitions_ValidatePageTypeDefinitions_ValidatesEachPageType()
        {
            MockRepository            fakes       = new MockRepository();
            List <PageTypeDefinition> definitions = new List <PageTypeDefinition>();
            PageTypeDefinition        definition  = new PageTypeDefinition
            {
                Type      = typeof(TypedPageData),
                Attribute = new PageTypeAttribute()
            };

            definitions.Add(definition);
            PageTypeDefinitionValidator definitionValidator = fakes.PartialMock <PageTypeDefinitionValidator>((PageDefinitionTypeMapper)null);

            definitionValidator.Stub(validator => validator.ValidatePageTypeDefinition(definition, definitions));
            definitionValidator.Replay();

            definitionValidator.ValidatePageTypeDefinitions(definitions);

            definitionValidator.AssertWasCalled(validator => validator.ValidatePageTypeDefinition(definition, definitions));
        }