Exemplo n.º 1
0
        public void TestSetDaemonAddress()
        {
            var    emitter    = new UdpSegmentEmitter();
            string newAddress = "10.10.10.10:1234";

            emitter.SetDaemonAddress(newAddress);
            Assert.AreEqual(newAddress, emitter.EndPoint.ToString());
        }
Exemplo n.º 2
0
        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);
        }