public void TestSetDaemonAddress() { var emitter = new UdpSegmentEmitter(); string newAddress = "10.10.10.10:1234"; emitter.SetDaemonAddress(newAddress); Assert.AreEqual(newAddress, emitter.EndPoint.ToString()); }
public void TestDefaultDaemonAddress() { var emitter = new UdpSegmentEmitter(); var expected = "127.0.0.1:2000"; var actual = emitter.EndPoint.ToString(); Assert.AreEqual(expected, actual); }
public void TestEnvironmentVariableOverrideSetDaemonAddress() { var environmentAddress = "1.1.1.1:123"; var localAddress = "2.2.2.2:456"; Environment.SetEnvironmentVariable(UdpSegmentEmitter.EnvironmentVariableDaemonAddress, environmentAddress); var emitter = new UdpSegmentEmitter(); emitter.SetDaemonAddress(localAddress); Assert.AreEqual(environmentAddress, emitter.EndPoint.ToString()); Environment.SetEnvironmentVariable(UdpSegmentEmitter.EnvironmentVariableDaemonAddress, null); }