csharptest | 27bfcc5 | 2011-06-02 12:04:06 -0500 | [diff] [blame] | 1 | using System.ComponentModel;
|
| 2 | using System.IO;
|
| 3 | using NUnit.Framework;
|
| 4 |
|
| 5 | namespace Google.ProtocolBuffers.CompatTests
|
| 6 | {
|
| 7 | [TestFixture]
|
| 8 | public class TextCompatibilityTests : CompatibilityTests
|
| 9 | {
|
csharptest | 27bfcc5 | 2011-06-02 12:04:06 -0500 | [diff] [blame] | 10 | protected override object SerializeMessage<TMessage, TBuilder>(TMessage message)
|
| 11 | {
|
| 12 | StringWriter text = new StringWriter();
|
| 13 | message.PrintTo(text);
|
| 14 | return text.ToString();
|
| 15 | }
|
| 16 |
|
| 17 | protected override TBuilder DeerializeMessage<TMessage, TBuilder>(object message, TBuilder builder, ExtensionRegistry registry)
|
| 18 | {
|
| 19 | TextFormat.Merge(new StringReader((string)message), registry, (IBuilder)builder);
|
| 20 | return builder;
|
| 21 | }
|
| 22 |
|
| 23 | [Test, Explicit, Description("This test can take a very long time to run.")]
|
csharptest | 27bfcc5 | 2011-06-02 12:04:06 -0500 | [diff] [blame] | 24 | public override void RoundTripMessage2OptimizeSize()
|
| 25 | {
|
| 26 | base.RoundTripMessage2OptimizeSize();
|
| 27 | }
|
| 28 |
|
| 29 | [Test, Explicit, Description("This test can take a very long time to run.")]
|
| 30 | public override void RoundTripMessage2OptimizeSpeed()
|
| 31 | {
|
| 32 | base.RoundTripMessage2OptimizeSpeed();
|
| 33 | }
|
csharptest | 27bfcc5 | 2011-06-02 12:04:06 -0500 | [diff] [blame] | 34 | }
|
| 35 | } |