public SetNetworkInterface(IExecutableProcessQueue executableProcessQueue, IWmiMacNetworkNameGetter wmiMacNetworkNameGetter, ILogger logger, IIPFinder ipFinder) { _executableProcessQueue = executableProcessQueue; _wmiMacNetworkNameGetter = wmiMacNetworkNameGetter; _logger = logger; _ipFinder = ipFinder; }
internal void Setup(string macAddress, bool multipleIps, bool oneDisabledIp, bool noDns) { Logger = MockRepository.GenerateMock <ILogger>(); ExecutableProcessQueue = MockRepository.GenerateMock <IExecutableProcessQueue>(); ExecutableProcessQueue.Stub(x => x.Enqueue(Arg <string> .Is.Anything, Arg <string> .Is.Anything)).Return( ExecutableProcessQueue); _mockIPFinder = MockRepository.GenerateMock <IIPFinder>(); _mockIPFinder.Stub(x => x.findIpv6Addresses("Lan1")).Return(new List <IPAddress>()); WmiMacNetworkNameGetter = MockRepository.GenerateMock <IWmiMacNetworkNameGetter>(); WmiMacNetworkNameGetter.Stub(x => x.Get()).Return(new Dictionary <string, string> { { "Lan1", "FAKEMAC" }, { "Lan2", "" } }).Repeat.Once(); WmiMacNetworkNameGetter.Stub(x => x.Get()).Return(new Dictionary <string, string> { { "Lan1", "FAKEMAC" }, { "Lan2", "FAKEMAC2" } }); NetworkInterface = multipleIps ? GetMeANetworkInterfaceWithAPrimaryAndSecondaryIp(macAddress) : GetMeANetworkInterface(macAddress); if (noDns) { NetworkInterface.dns = null; } if (oneDisabledIp) { NetworkInterface.ips[1].enabled = "0"; } new MockRepository().Ordered(); ExecutableProcessQueue.Replay(); }
internal void Setup(string macAddress, bool multipleIps, bool oneDisabledIp, bool noDns) { Logger = MockRepository.GenerateMock<ILogger>(); ExecutableProcessQueue = MockRepository.GenerateMock<IExecutableProcessQueue>(); ExecutableProcessQueue.Stub(x => x.Enqueue(Arg<string>.Is.Anything, Arg<string>.Is.Anything)).Return( ExecutableProcessQueue); _mockIPFinder = MockRepository.GenerateMock<IIPFinder>(); _mockIPFinder.Stub(x => x.findIpv6Addresses("Lan1")).Return(new List<IPAddress>()); WmiMacNetworkNameGetter = MockRepository.GenerateMock<IWmiMacNetworkNameGetter>(); WmiMacNetworkNameGetter.Stub(x => x.Get()).Return(new Dictionary<string, string> {{"Lan1", "FAKEMAC"}, {"Lan2", ""}}).Repeat.Once(); WmiMacNetworkNameGetter.Stub(x => x.Get()).Return(new Dictionary<string, string> {{"Lan1", "FAKEMAC"}, {"Lan2", "FAKEMAC2"}}); NetworkInterface = multipleIps ? GetMeANetworkInterfaceWithAPrimaryAndSecondaryIp(macAddress) : GetMeANetworkInterface(macAddress); if (noDns) NetworkInterface.dns = null; if (oneDisabledIp) NetworkInterface.ips[1].enabled = "0"; new MockRepository().Ordered(); ExecutableProcessQueue.Replay(); }
public IpChecker(IIPFinder iPFinder) { this._iPFinder = iPFinder; }