public TestServiceProvider() { TestMachineName = "."; ControlTimeout = TimeSpan.FromSeconds(120); TestServiceName = Guid.NewGuid().ToString(); TestServiceDisplayName = "Test Service " + TestServiceName; _dependentServices = new TestServiceProvider(TestServiceName + ".Dependent"); // Create the service CreateTestServices(); }
private ServiceController ConnectToServer() { TestServiceProvider.DebugTrace("ServiceBaseTests.ConnectToServer: connecting"); _testService.Client.Connect(connectionTimeout); Assert.Equal((int)PipeMessageByteCode.Connected, _testService.GetByte()); TestServiceProvider.DebugTrace("ServiceBaseTests.ConnectToServer: received connect byte"); ServiceController controller = new ServiceController(_testService.TestServiceName); AssertExpectedProperties(controller); return(controller); }
public void NoServiceNameOnServiceBase() { // When installing a service, you must supply a non empty name. // When a service starts itself (using StartServiceCtrlDispatcher) it's legal to pass an empty string for the name. string serviceName = "NoServiceNameOnServiceBase"; var testService = new TestServiceProvider(serviceName); // Ensure it has successfully written to the event log, // indicating it figured out its own name. Assert.True(EventLog.SourceExists(serviceName)); testService.DeleteTestServices(); }
public ServiceBaseTests() { _testService = new TestServiceProvider(); }
public ServiceControllerTests() { _testService = new TestServiceProvider(); }