示例#1
0
 public void EnsureTheSameInstanceOfPortAllocatorIsAlwaysUsedWhenOnceIsNotSpecifiedInTheConstructor()
 {
     var driver = new VlcDriver();
     var job1 = driver.CreateAudioJob();
     var job2 = driver.CreateAudioJob();
     Assert.AreNotEqual(job1, job2);
     Assert.AreEqual(job1.PortAllocator, job2.PortAllocator);
 }
示例#2
0
 public void TestAudioJobCreation()
 {
     var driver = new VlcDriver();
     var job = driver.CreateAudioJob();
     Assert.IsNotNull(job);
     Assert.AreEqual(8081, job.PortAllocator.StartPort);
 }
示例#3
0
 public void EnsureTheSameInstanceOfPortAllocatorIsAlwaysUsedWhenOnceIsSpecifiedInTheConstructor()
 {
     var portAllocator = new PortAllocator(MockRepository.GenerateMock<ILogger>());
     var driver = new VlcDriver(null, portAllocator);
     var job = driver.CreateAudioJob();
     Assert.AreEqual(portAllocator, job.PortAllocator);
 }
示例#4
0
        public void EnsureWeAllocatePortAllocatorTheStartingPortFromSettings()
        {
            var oldPort = VLCDriver.Properties.Settings.Default.StartPort;

            VLCDriver.Properties.Settings.Default.StartPort = -3;
            var driver = new VlcDriver();
            var job = driver.CreateAudioJob();
            var actualPort = job.PortAllocator.StartPort;
            VLCDriver.Properties.Settings.Default.StartPort = oldPort;
            Assert.AreEqual(-3, actualPort);
        }