public void EngineApiPositionTest()
        {
            var content = _unitTestEngine.WithPublishedContentPage(index: 1);

            var controller = new BasicUmbracoApiController(_unitTestEngine.UmbracoContext, _unitTestEngine.UmbracoHelper);
            var res        = controller.BasicPositionAction(content.Id);

            Assert.IsFalse(res);
        }
        public void BasicApiPositionTest()
        {
            var appCtx = ApplicationContext.EnsureContext(
                new DatabaseContext(Mock.Of <IDatabaseFactory>(), Mock.Of <ILogger>(), new SqlSyntaxProviders(new[] { Mock.Of <ISqlSyntaxProvider>() })),
                new ServiceContext(),
                CacheHelper.CreateDisabledCacheHelper(),
                new ProfilingLogger(
                    Mock.Of <ILogger>(),
                    Mock.Of <IProfiler>()), true);

            var ctx = UmbracoContext.EnsureContext(
                Mock.Of <HttpContextBase>(),
                appCtx,
                new Mock <WebSecurity>(null, null).Object,
                Mock.Of <IUmbracoSettingsSection>(),
                Enumerable.Empty <IUrlProvider>(), true);

            var contentId = 2;
            //get a mocked IPublishedContent
            var contentMock = BasicHelpers.GetPublishedContentMock();

            contentMock.Setup(s => s.GetIndex()).Returns(1);

            var mockedTypedQuery = new Mock <ITypedPublishedContentQuery>();

            mockedTypedQuery.Setup(s => s.TypedContent(contentId)).Returns(contentMock.Object);

            //give our dynamic query mock to the longer version of the UmbracoHelper constructor
            var helper = new UmbracoHelper(ctx,
                                           Mock.Of <IPublishedContent>(),
                                           mockedTypedQuery.Object,
                                           Mock.Of <IDynamicPublishedContentQuery>(),
                                           Mock.Of <ITagQuery>(),
                                           Mock.Of <IDataTypeService>(),
                                           new UrlProvider(ctx, Mock.Of <IWebRoutingSection>(section => section.UrlProviderMode == UrlProviderMode.Auto.ToString()), new[] { Mock.Of <IUrlProvider>() }),
                                           Mock.Of <ICultureDictionary>(),
                                           Mock.Of <IUmbracoComponentRenderer>(),
                                           new MembershipHelper(ctx, Mock.Of <MembershipProvider>(), Mock.Of <RoleProvider>()));

            var controller = new BasicUmbracoApiController(ctx, helper);
            var res        = controller.BasicPositionAction(contentId);

            //not first
            Assert.IsFalse(res);
        }