public void SetUp() { messageSerializers = new IMessageSerializer[] {new BinarySerializer(), new BasicJsonMessageSerializer(), new XmlMessageSerializer()}; theGraph = new ChannelGraph(); theSerializer = new EnvelopeSerializer(theGraph, messageSerializers); theAddress = new Address {City = "Jasper", State = "Missouri"}; }
public void can_round_trip() { var address1 = new Address { City = "Austin", State = "Texas" }; var stream = new MemoryStream(); var serializer = new BinarySerializer(); serializer.Serialize(address1, stream); stream.Position = 0; var address2 = serializer.Deserialize(stream).ShouldBeOfType<Address>(); address1.ShouldEqual(address2); }
protected bool Equals(Address other) { return string.Equals(City, other.City) && string.Equals(State, other.State); }