public void OutputWriterObtained() { OutputFactory outputFactory = new OutputFactory(); IOutputWriter outWriter = outputFactory.CreateOutputWriter(); Debug.Write("Test OutputWriterObtained"); Assert.IsNotNull(outWriter); }
public void OutputWriterCustomProcessingRun() { OutputFactory outputFactory = new OutputFactory(); IOutputWriter outWriter = outputFactory.CreateOutputWriter(); Debug.Write("Test OutputWriterObtained"); Assert.IsTrue(outWriter.CustomProcessing()); }
public void OutputWriterWriteOutputRun() { OutputFactory outputFactory = new OutputFactory(); IOutputWriter outWriter = outputFactory.CreateOutputWriter(); Debug.Write("Test OutputWriterOutputRun"); Assert.IsTrue(outWriter.WriteOutput("Hello World from Testing")); }
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(); }