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); }
public void TestAudioJobCreation() { var driver = new VlcDriver(); var job = driver.CreateAudioJob(); Assert.IsNotNull(job); Assert.AreEqual(8081, job.PortAllocator.StartPort); }
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); }
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); }