IPMeow/test/IPMeow.Test/StructTests.cs
2023-05-03 13:11:27 +02:00

20 lines
517 B
C#

using IPMeow.Lib;
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);
}
}