コード例 #1
0
        public void OutputWriterObtained()
        {
            OutputFactory outputFactory = new OutputFactory();
            IOutputWriter outWriter     = outputFactory.CreateOutputWriter();

            Debug.Write("Test OutputWriterObtained");
            Assert.IsNotNull(outWriter);
        }
コード例 #2
0
        public void OutputWriterCustomProcessingRun()
        {
            OutputFactory outputFactory = new OutputFactory();
            IOutputWriter outWriter     = outputFactory.CreateOutputWriter();

            Debug.Write("Test OutputWriterObtained");

            Assert.IsTrue(outWriter.CustomProcessing());
        }
コード例 #3
0
        public void OutputWriterWriteOutputRun()
        {
            OutputFactory outputFactory = new OutputFactory();
            IOutputWriter outWriter     = outputFactory.CreateOutputWriter();

            Debug.Write("Test OutputWriterOutputRun");

            Assert.IsTrue(outWriter.WriteOutput("Hello World from Testing"));
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: gsmolyar/CHAPITest
        static void Main(string[] args)
        {
            // Instantiate the Factory
            OutputFactory outputFactory = new OutputFactory();

            // Ask Factory to instantiate the specific output writer based on configuration
            IOutputWriter outWriter = outputFactory.CreateOutputWriter();

            // Execute the output writer's functions directly
            outWriter.CustomProcessing();
            outWriter.WriteOutput("Hello World");

            // Invoke another class's functionality with OutputWriter injected dynamically at run time (Dependency Injection)
            TestRunner testRunr = new TestRunner(outWriter, "Hello World");

            // Execute the output writer's functions directly
            testRunr.CustomProcessing();
            testRunr.WriteOutput();



            //TODO: establish Web API connection to the service

            // Get the service URI

            //var actionUrl = .Action("Content", "Import", new
            //{
            //    httproute = true,
            //    area = "Orchard.ImportExport"
            //});
            //IServiceProvider service = new CHAPITest.Controllers.CHAPIController();
            //CHAPITest.Controllers.CHAPIController.GetURL
            //string uri = Url.Action("POST", "CHAPIController", new { }, HttpWebRequest.Url.Scheme);

            //var url = new UrlHelper(HttpContext.Current.Request.RequestContext);
            //item.Url = url.Action("POST", "CHAPI");


            //// Call REST client with input string
            //RESTClient restClient = new RESTClient("/api/CHAPI", "Hello, World", HTTPVerb.POST);
            //string result = restClient.MakeRequest();
        }