ToBinary() public method

public ToBinary ( ) : byte[]
return byte[]
        public void given_empty_comment()
        {
            var source = new Comment();

            var bin = source.ToBinary();
            var restored = Comment.TryGetFromBinary(bin);

            ShouldBeEqual(source, restored);
        }
        public void given_populated_comment()
        {
            var source = new Comment()
                {
                    Id = 100,
                    Text = "Comment for test",
                    CreationDate = new DateTime(2011, 12, 1, 13, 13, 13),
                    PostId = 12,
                    Score = 2,
                    UserId = 11
                };

            var bin = source.ToBinary();
            var restored = Comment.TryGetFromBinary(bin);

            ShouldBeEqual(source, restored);
        }