Skip to content

Commit

Permalink
create by.enum test
Browse files Browse the repository at this point in the history
  • Loading branch information
alec1o committed May 6, 2024
1 parent 5c97fe4 commit 41faa43
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion test/by/By.WriteAndRead.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Net.Sockets;
using System.Numerics;
using Byter;
using Xunit;
Expand Down Expand Up @@ -279,14 +280,32 @@ public void ByBigInteger()
Assert.True(b.IsValid);
}

[Fact(Skip = "Enum")]
[Fact]
public void ByEnum()
{
By b = new By();

b.Add(SocketType.Unknown);
b.Add(SocketType.Stream);
b.Add(SocketType.Dgram);
b.Add(SocketType.Raw);
b.Add(SocketType.Rdm);
b.Add(SocketType.Seqpacket);

Assert.Equal(SocketType.Unknown, b.Get<SocketType>());
Assert.Equal(SocketType.Stream, b.Get<SocketType>());
Assert.Equal(SocketType.Dgram, b.Get<SocketType>());
Assert.Equal(SocketType.Raw, b.Get<SocketType>());
Assert.Equal(SocketType.Rdm, b.Get<SocketType>());
Assert.Equal(SocketType.Seqpacket, b.Get<SocketType>());

Assert.True(b.IsValid);
}

[Fact(Skip = "TODO")]
public void ByArray()
{

}

[Fact(Skip = "TODO")]
Expand Down

0 comments on commit 41faa43

Please sign in to comment.