package com.krillsson.sysapi.core.windows;

import ohmwrapper.MonitorManager;
import org.junit.Before;
import oshi.hardware.HardwareAbstractionLayer;

import static org.junit.Assert.*;
import static org.junit.Assert.*;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

public class WindowsNetworkProviderTest {

    MonitorManager monitorManager;
    HardwareAbstractionLayer hal;

    @Before
    public void setUp() throws Exception {
        monitorManager = mock(MonitorManager.class);
    }
}
@@ -48,33 +48,252 @@
 ort 
-ohmwrapper.MonitorManager
+com.krillsson.sysapi.core.SpeedMeasurementManager;%0Aimport com.krillsson.sysapi.core.domain.network.NetworkInterfaceSpeed;%0Aimport ohmwrapper.Bandwidth;%0Aimport ohmwrapper.MonitorManager;%0Aimport ohmwrapper.NetworkMonitor;%0Aimport ohmwrapper.NicInfo
 ;%0Aim
@@ -315,16 +315,39 @@
 Before;%0A
+import org.junit.Test;%0A
 import o
@@ -385,16 +385,110 @@
 nLayer;%0A
+import oshi.hardware.NetworkIF;%0Aimport sun.nio.ch.Net;%0A%0Aimport static org.hamcrest.core.Is.is;
 %0Aimport 
@@ -715,144 +715,1886 @@
     
-HardwareAbstractionLayer hal;%0A%0A    @Before%0A    public void setUp() throws Exception %7B%0A        monitorManager = mock(MonitorManager.class
+NetworkMonitor networkMonitor;%0A    HardwareAbstractionLayer hal;%0A    NetworkIF networkIF;%0A    NicInfo nicInfo;%0A    Bandwidth inBandwidth;%0A    Bandwidth outBandwidth;%0A%0A    WindowsNetworkProvider nicProvider;%0A%0A    @Before%0A    public void setUp() throws Exception %7B%0A        monitorManager = mock(MonitorManager.class);%0A        networkMonitor = mock(NetworkMonitor.class);%0A        when(monitorManager.getNetworkMonitor()).thenReturn(networkMonitor);%0A        hal = mock(HardwareAbstractionLayer.class);%0A        networkIF = mock(NetworkIF.class);%0A        nicInfo = mock(NicInfo.class);%0A        inBandwidth = mock(Bandwidth.class);%0A        outBandwidth = mock(Bandwidth.class);%0A        when(nicInfo.getInBandwidth()).thenReturn(inBandwidth);%0A        when(nicInfo.getOutBandwidth()).thenReturn(outBandwidth);%0A        when(inBandwidth.getValue()).thenReturn(123d);%0A        when(outBandwidth.getValue()).thenReturn(321d);%0A%0A        nicProvider = new WindowsNetworkProvider(hal, mock(SpeedMeasurementManager.class));%0A        nicProvider.setMonitorManager(monitorManager);%0A    %7D%0A%0A    @Test%0A    public void happyPath() throws Exception %7B%0A        when(hal.getNetworkIFs()).thenReturn(new NetworkIF%5B%5D%7BnetworkIF%7D);%0A        when(networkIF.getName()).thenReturn(%22en0%22);%0A        when(networkIF.getMacaddr()).thenReturn(%2201:23:45:67:89:ab%22);%0A        when(networkMonitor.getNics()).thenReturn(new NicInfo%5B%5D%7BnicInfo%7D);%0A        when(nicInfo.getPhysicalAddress()).thenReturn(%2201:23:45:67:89:AB%22);%0A%0A        NetworkInterfaceSpeed en0 = nicProvider.getSpeed(%22en0%22);%0A        assertThat(en0.getRxbps(), is(123L));%0A        assertThat(en0.getTxbps(), is(321L));%0A    %7D%0A%0A    @Test%0A    public void noAvailableSpeedRecordsReturnsDefaultValues() throws Exception %7B%0A        NetworkInterfaceSpeed en0 = nicProvider.getSpeed(%22en0%22);%0A        assertThat(en0.getRxbps(), is(0L));%0A        assertThat(en0.getTxbps(), is(0L)
 );%0A 

Add tests for WindowsNetworkProvider