ToBinary() public méthode

public ToBinary ( ) : byte[]
Résultat byte[]
        public void given_empty_post()
        {
            var source = new Post();

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

            ShouldBeEqual(source, restored);
        }
        public void given_filled_post()
        {
            var source = new Post
                {
                    Id = 101,
                    AnswerCount = 4,
                    Body = "Post body test",
                    CommentCount = 5,
                    CreationDate = new DateTime(2011, 12, 1, 13, 13, 13),
                    FavoriteCount = 9,
                    LastEditDate = new DateTime(2012, 12, 1, 13, 13, 13),
                    OwnerUserId = 45,
                    PostTypeId = 23,
                    Tags = new[] { "c#", ".net", "java" },
                    Title = "Post title test",
                    ViewCount = 555
                };

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

            ShouldBeEqual(source, restored);
        }