public void ArpService_ProcessArpOutput_String() { _arpService.ClearArpCache(); var arpRefreshStatus = InvokeArpRefreshStatus(_arpresultsTest, CancellationToken.None); arpRefreshStatus.Should().NotBeNull(); }
public async Task ArpService_CancelRequest() { var cancellationTokenSource = new CancellationTokenSource(); // Start ArpService Assert.Equal(ServiceHostStatus.Stopped, _arpService.ServiceHostStatus); await _arpService.StartAsync(cancellationTokenSource.Token); Assert.Equal(ServiceHostStatus.Running, _arpService.ServiceHostStatus); var cts = new CancellationTokenSource(); cts.CancelAfter(10); _arpService.ClearArpCache(); var arpItem = await _arpService.GetArpItemAsync(_defaultGatewayIPAddressSubnet.IPAddress, cts.Token); arpItem.Should().BeNull(); await _arpService.StopAsync(cancellationTokenSource.Token); }