IPMeow/test/IPMeow.Test/StructTests.cs

20 lines
498 B
C#
Raw Normal View History

2023-05-03 13:11:27 +02:00
using IPMeow.Lib.Address;
2023-04-17 00:40:26 +02:00
namespace IPMeow.Test;
public class StructTests
{
[Fact]
public void MacAddressSerializationTest()
{
2023-05-03 13:11:27 +02:00
var addrFromString = MacAddress.Parse("fe:ed:de:ad:be:ef");
var addrFromBytes = MacAddress.Parse(new byte[] { 0xfe, 0xed, 0xde, 0xad, 0xbe, 0xef });
2023-04-17 00:40:26 +02:00
Assert.Equal(addrFromString, addrFromBytes);
string addrString = addrFromBytes.ToString();
Assert.Equal("fe:ed:de:ad:be:ef", addrString);
}
}