public void BinarySerializer_Primitives <T>(T value) { // arrange var serializer = new BinaryCacheSerializer(); // act var data = serializer.Serialize(value); var result = serializer.Deserialize(data, typeof(T)); result.Should().Be(value); }
public void BinarySerializer_Pocco() { // arrange var serializer = new BinaryCacheSerializer(); var item = SerializerPoccoSerializable.Create(); // act var data = serializer.Serialize(item); var result = serializer.Deserialize(data, item.GetType()); result.ShouldBeEquivalentTo(item); }
public void BinarySerializer_List() { // arrange var serializer = new BinaryCacheSerializer(); var items = new List <SerializerPoccoSerializable>() { SerializerPoccoSerializable.Create(), SerializerPoccoSerializable.Create(), SerializerPoccoSerializable.Create() }; // act var data = serializer.Serialize(items); var result = serializer.Deserialize(data, items.GetType()); result.ShouldBeEquivalentTo(items); }