public void LocalIpAddress_Multiple_TakesFirstWithGatewayUp()
        {
            // Arrange
            var networkInterfaceRetrieverMock = new NetworkInterfaceRetrieverBuilder()
                                                .WithInterface(NetworkInterfaceType.Ethernet, "F0-E0-D2-C3-B4-A5", OperationalStatus.Dormant)
                                                .WithIp("10.0.1.1", "10.0.1.0")
                                                .WithInterface(NetworkInterfaceType.Ethernet, Mac1, OperationalStatus.Up)
                                                .WithIp("10.0.1.2")
                                                .WithInterface(NetworkInterfaceType.Ethernet, Mac1, OperationalStatus.Up)
                                                .WithIp("10.0.1.3", "10.0.1.0")
                                                .Build();

            var ipAddressRenderer = new LocalIpAddressLayoutRenderer(networkInterfaceRetrieverMock);

            // Act
            var result = ipAddressRenderer.Render(LogEventInfo.CreateNullEvent());

            // Assert
            Assert.Equal("10.0.1.3", result);
        }
        public void LocalIpAddress_Multiple_TakesFirstIpv6IfRequested()
        {
            // Arrange
            var ipv6 = "fe80::200:f8ff:fe21:67cf";

            var networkInterfaceRetrieverMock = new NetworkInterfaceRetrieverBuilder()
                                                .WithInterface(NetworkInterfaceType.Ethernet, "F0-E0-D2-C3-B4-A5")
                                                .WithIp("1.0.10.11")
                                                .WithInterface(NetworkInterfaceType.Ethernet, Mac1)
                                                .WithIp(ipv6)
                                                .Build();

            var ipAddressRenderer = new LocalIpAddressLayoutRenderer(networkInterfaceRetrieverMock)
            {
                AddressFamily = AddressFamily.InterNetworkV6
            };

            // Act
            var result = ipAddressRenderer.Render(LogEventInfo.CreateNullEvent());

            // Assert
            Assert.Equal(ipv6, result);
        }