IPMeow/test/IPMeow.Test/StructTests.cs

21 lines
500 B
C#
Raw Normal View History

2023-04-17 00:40:26 +02:00
using IPMeow.Lib;
using Xunit;
namespace IPMeow.Test;
public class StructTests
{
[Fact]
public void MacAddressSerializationTest()
{
var addrFromString = new MacAddress("fe:ed:de:ad:be:ef");
var addrFromBytes = new MacAddress(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);
}
}