public void Boolean() { var boolean = new Boolean(true); bool b = boolean; Assert.Equal(b, boolean.Value); }
public void Boolean() { var t = new Bencodex.Types.Boolean(true); var f = new Bencodex.Types.Boolean(false); AssertEqual( new byte[] { 0x74 }, // "t" _codec.Encode(t) ); AssertEqual( new byte[] { 0x66 }, // "f" _codec.Encode(f) ); Assert.Equal("true", t.Inspection); Assert.Equal("false", f.Inspection); Assert.Equal("Bencodex.Types.Boolean true", t.ToString()); Assert.Equal("Bencodex.Types.Boolean false", f.ToString()); }