[Test] public void Test_WCFHost_Start() { // stop the current one Assert.IsTrue(HostStarted); WCFHost_Stop(); Assert.IsFalse(HostStarted); // create a rest service with a random port and without using the Design_Time_Addresses // NOTE: this test will fail if VS is run with Admin privs var currentTemplate = Tests_Consts.TM_REST_Url_Template; var currentPort = Tests_Consts.TM_REST_Service_Port; Tests_Consts.TM_REST_Url_Template = currentTemplate.replace("Design_Time_Addresses", "ABCD"); Tests_Consts.TM_REST_Service_Port = 20000.randomNumber(); var tmRestHosted = new TM_Rest_Hosted(); Assert.IsNotNull(tmRestHosted); tmRestHosted.WCFHost_Start(); Assert.IsTrue(tmRestHosted.HostStarted); Tests_Consts.TM_REST_Service_Port = currentPort; Tests_Consts.TM_REST_Url_Template = currentTemplate; }
public void Test_WCFHost_Start() { // stop the current one Assert.IsTrue(HostStarted); WCFHost_Stop(); Assert.IsFalse(HostStarted); // create a rest service with a random port and without using the Design_Time_Addresses // NOTE: this test will fail if VS is run with Admin privs var currentTemplate = Tests_Consts.TM_REST_Url_Template; var currentPort = Tests_Consts.TM_REST_Service_Port; Tests_Consts.TM_REST_Url_Template = currentTemplate.replace("Design_Time_Addresses","ABCD"); Tests_Consts.TM_REST_Service_Port = 20000.randomNumber(); var tmRestHosted = new TM_Rest_Hosted(); Assert.IsNotNull(tmRestHosted); tmRestHosted.WCFHost_Start(); Assert.IsTrue(tmRestHosted.HostStarted); Tests_Consts.TM_REST_Service_Port = currentPort; Tests_Consts.TM_REST_Url_Template = currentTemplate; }