public CatalogProductItemResolver()
 {
     this.SearchManager = ServiceLocatorHelper.GetService <ISearchManager>();
     Assert.IsNotNull((object)this.SearchManager, "this.SearchManager service could not be located.");
     this.StorefrontContext = ServiceLocatorHelper.GetService <IStorefrontContext>();
     Assert.IsNotNull((object)this.StorefrontContext, "this.StorefrontContext service could not be located.");
     this.ItemTypeProvider = ServiceLocatorHelper.GetService <IItemTypeProvider>();
     Assert.IsNotNull((object)this.ItemTypeProvider, "this.ItemTypeProvider service could not be located.");
     this.CatalogUrlManager = ServiceLocatorHelper.GetService <ICatalogUrlManager>();
     Assert.IsNotNull((object)this.CatalogUrlManager, "this.CatalogUrlManager service could not be located.");
     this.SiteContext = ServiceLocatorHelper.GetService <ISiteContext>();
     Assert.IsNotNull((object)this.SiteContext, "this.SiteContext service could not be located.");
     this.Context = ServiceLocatorHelper.GetService <IContext>();
     Assert.IsNotNull((object)this.SiteContext, "this.SitecoreContext service could not be located.");
 }
示例#2
0
        static void Main(string[] args)
        {
            Console.Title           = "SkippyNet - Api Tests";
            Console.WindowHeight    = 40;
            Console.WindowWidth     = 120;
            Console.ForegroundColor = ConsoleColor.Green;
            Console.WriteLine("Press 'm' for menu or 'q' to quit.");
            Console.WriteLine();

            ServiceLocatorHelper.Initialize();
            var testController = ServiceLocatorHelper.Resolve <ITestController>();

            while (true)
            {
                var line = Console.ReadLine();
                if (line == null)
                {
                    continue;
                }

                if (line.ToLower().Equals("m"))
                {
                    Console.WriteLine("Press '0' to run All Api tests.");
                    Console.WriteLine("Press '1' to run Work Api tests.");
                    Console.WriteLine();
                }

                if (line.ToLower().Equals("0"))
                {
                    Console.WriteLine("Running All Api Tests...");
                    Console.WriteLine();
                    testController.Run(TestType.All);
                }

                if (line.ToLower().Equals("1"))
                {
                    Console.WriteLine("Running Work Api Tests...");
                    Console.WriteLine();
                    testController.Run(TestType.Work);
                }

                if (line.ToLower().Equals("q"))
                {
                    break;
                }
            }
        }