public void BinarySerialization() { string message = "Error message"; TwitterApiError error = TwitterApiError.RateLimitExceeded; TwitterApiException exBefore = new TwitterApiException(message, error); TwitterApiException exAfter = SerializationTestUtils.BinarySerializeAndDeserialize(exBefore) as TwitterApiException; Assert.IsNotNull(exAfter); Assert.AreEqual(message, exAfter.Message, "Invalid message"); Assert.AreEqual(error, exAfter.Error, "Invalid error"); }