IPMeow/test/IPMeow.Test/StructTests.cs

19 lines
498 B
C#

using IPMeow.Lib.Address;
namespace IPMeow.Test;
public class StructTests
{
[Fact]
public void MacAddressSerializationTest()
{
var addrFromString = MacAddress.Parse("fe:ed:de:ad:be:ef");
var addrFromBytes = MacAddress.Parse(new byte[] { 0xfe, 0xed, 0xde, 0xad, 0xbe, 0xef });
Assert.Equal(addrFromString, addrFromBytes);
string addrString = addrFromBytes.ToString();
Assert.Equal("fe:ed:de:ad:be:ef", addrString);
}
}