Exemplo n.º 1
0
        public void Execute_RequestedTypeItem_ConfigForItem()
        {
            //Arrange
            SitecoreTypeConfiguration expected = SitecoreItemResolverTask.Config;
            var task = new SitecoreItemResolverTask();
            var args = new ConfigurationResolverArgs(null, null, typeof(Item), null);

            //Act
            task.Execute(args);

            //Arrange
            Assert.AreEqual(expected, args.Result);
        }
        public void Execute_ResultIsNotNull_DoesNothing()
        {
            //Arrange
            var expected = new SitecoreTypeConfiguration();
            var task     = new SitecoreItemResolverTask();
            var args     = new ConfigurationResolverArgs(null, null, null);

            args.Result = expected;

            //Act
            task.Execute(args);

            //Arrange
            Assert.AreEqual(expected, args.Result);
        }
        public void Execute_RequestedTypeItem_ConfigForItem()
        {
            //Arrange
            SitecoreTypeConfiguration expected = SitecoreItemResolverTask.Config;
            var task    = new SitecoreItemResolverTask();
            var context = new SitecoreTypeCreationContext();

            context.Options = new GetItemOptions()
            {
                Type = typeof(Item)
            };

            var args = new ConfigurationResolverArgs(null, context, null);

            //Act
            task.Execute(args);

            //Arrange
            Assert.AreEqual(expected, args.Result);
        }