Example #1
0
        public void GivenPageType_UpdatePageTypePropertyDefinitions_CallsGetExistingPageDefinition()
        {
            List <PageTypePropertyDefinition> definitions = new List <PageTypePropertyDefinition>();
            PageTypePropertyDefinition        pageTypePropertyDefinition = PageTypePropertyUpdaterTestsUtility.CreatePageTypePropertyDefinition();

            definitions.Add(pageTypePropertyDefinition);
            PageTypePropertyUpdater pageTypePropertyUpdater = CreatePageTypePropertyUpdater(definitions);
            IPageType          pageType           = new NativePageType();
            PageTypeDefinition pageTypeDefinition = new PageTypeDefinition();

            pageTypePropertyUpdater.Stub(utility => utility.GetExistingPageDefinition(
                                             pageType, pageTypePropertyDefinition)).Return(new PageDefinition());
            pageTypePropertyUpdater.Stub(
                utility => utility.UpdatePageDefinition(
                    Arg <PageDefinition> .Is.Anything, Arg <PageTypePropertyDefinition> .Is.Anything));
            pageTypePropertyUpdater.Replay();

            pageTypePropertyUpdater.UpdatePageTypePropertyDefinitions(pageType, pageTypeDefinition);

            pageTypePropertyUpdater.AssertWasCalled(
                utility => utility.GetExistingPageDefinition(
                    pageType, pageTypePropertyDefinition));
        }
Example #2
0
        private PageTypePropertyDefinition CreatePageTypePropertyDefinition()
        {
            PageTypePropertyDefinition propertyDefinition = PageTypePropertyUpdaterTestsUtility.CreatePageTypePropertyDefinition();

            return(propertyDefinition);
        }