Skip to content

Commit

Permalink
Add unit test for IpUtility
Browse files Browse the repository at this point in the history
  • Loading branch information
haga-rak committed Jan 20, 2024
1 parent e3cb652 commit c70de74
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions test/Fluxzy.Tests/UnitTests/Pcap/IpUtilityTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Fluxzy.Core.Pcap;
using Xunit;

namespace Fluxzy.Tests.UnitTests.Pcap
{
public class IpUtilityTests
{
[Fact]
public void DefaultRoute()
{
var firstAddr = IpUtility.GetDefaultRouteV4Address();
var secondAddr = IpUtility.GetDefaultRouteV4Address();

Assert.True(object.ReferenceEquals(firstAddr, secondAddr));
}

[Fact]
public void GetFreeEndPoint()
{
var endPoint = IpUtility.GetFreeEndpoint();

Assert.True(endPoint.Port > 0);
}

[Fact]
public void CaptureAvailabilityChecker_Available()
{
var available = CaptureAvailabilityChecker.Instance.IsAvailable;

Assert.True(available);
}
}
}

0 comments on commit c70de74

Please sign in to comment.