示例#1
0
        public void TestAgency_RuntimeFrameworkServiceError()
        {
            var fake = new FakeRuntimeService();

            fake.FailToStart = true;
            _services.Add(fake);
            var service = new TestAgency();

            _services.Add(service);
            ((IService)fake).StartService();
            service.StartService();
            Assert.That(service.Status, Is.EqualTo(ServiceStatus.Error));
        }
        public void SetUp()
        {
            _services = new ServiceContext();
            _services.Add(new ExtensionService());
            var projectService = new FakeProjectService();

            ((IService)projectService).StartService();
            projectService.Add(TestPackageFactory.FakeProject, "a.dll", "b.dll");
            _services.Add(projectService);
            Assert.That(((IService)projectService).Status, Is.EqualTo(ServiceStatus.Started));
            _factory = new DefaultTestRunnerFactory();
            _services.Add(_factory);
            _factory.StartService();
            Assert.That(_factory.Status, Is.EqualTo(ServiceStatus.Started));

            var fakeRuntimeService = new FakeRuntimeService();

            ((IService)fakeRuntimeService).StartService();
            _services.Add(fakeRuntimeService);
            Assert.That(((IService)fakeRuntimeService).Status, Is.EqualTo(ServiceStatus.Started));
        }
示例#3
0
 public void TestAgency_RuntimeFrameworkServiceError()
 {
     var fake = new FakeRuntimeService();
     fake.FailToStart = true;
     _services.Add(fake);
     var service = new TestAgency();
     _services.Add(service);
     ((IService)fake).StartService();
     service.StartService();
     Assert.That(service.Status, Is.EqualTo(ServiceStatus.Error));
 }