public void GetHashCodeMethod() { var view1 = new Yogi.MsgpackView(new byte[] { 11 }); var view2 = new Yogi.MsgpackView(new byte[] { 55 }); Assert.NotEqual(view1.GetHashCode(), view2.GetHashCode()); }
public void FromMsgpackView() { var msgpack_view = new Yogi.MsgpackView(new byte[] { 1, 2, 3 }); var view = new Yogi.PayloadView(msgpack_view); Assert.Equal(view.Data, msgpack_view.Data); Assert.Equal(view.Size, msgpack_view.Size); Assert.Equal(Yogi.EncodingType.Msgpack, view.Encoding); }
public void FromBuffer() { var data = new byte[] { 1, 2, 3 }; var view = new Yogi.MsgpackView(data); Assert.Equal(view.Data, data); Assert.Equal(view.Size, data.Length); view = data; Assert.Equal(view.Data, data); Assert.Equal(view.Size, data.Length); }
public void Comparison() { var view1 = new Yogi.MsgpackView(new byte[] { 11 }); var view2 = new Yogi.MsgpackView(new byte[] { 11 }); var view3 = new Yogi.MsgpackView(new byte[] { 55 }); Assert.True(view1 == view2); Assert.False(view1 == view3); Assert.False(view1 != view2); Assert.True(view1 != view3); Assert.False(view1.Equals(new Exception())); Assert.False(view1.Equals(null)); Assert.True(view1.Equals(view2)); Assert.False(view1.Equals(view3)); }