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 | {
|
| 10 | protected override string TestName { get { return "text"; } }
|
| 11 |
|
| 12 | protected override object SerializeMessage<TMessage, TBuilder>(TMessage message)
|
| 13 | {
|
| 14 | StringWriter text = new StringWriter();
|
| 15 | message.PrintTo(text);
|
| 16 | return text.ToString();
|
| 17 | }
|
| 18 |
|
| 19 | protected override TBuilder DeerializeMessage<TMessage, TBuilder>(object message, TBuilder builder, ExtensionRegistry registry)
|
| 20 | {
|
| 21 | TextFormat.Merge(new StringReader((string)message), registry, (IBuilder)builder);
|
| 22 | return builder;
|
| 23 | }
|
| 24 |
|
| 25 | [Test, Explicit, Description("This test can take a very long time to run.")]
|
csharptest | 27bfcc5 | 2011-06-02 12:04:06 -0500 | [diff] [blame] | 26 | public override void RoundTripMessage2OptimizeSize()
|
| 27 | {
|
| 28 | base.RoundTripMessage2OptimizeSize();
|
| 29 | }
|
| 30 |
|
| 31 | [Test, Explicit, Description("This test can take a very long time to run.")]
|
| 32 | public override void RoundTripMessage2OptimizeSpeed()
|
| 33 | {
|
| 34 | base.RoundTripMessage2OptimizeSpeed();
|
| 35 | }
|
csharptest | 27bfcc5 | 2011-06-02 12:04:06 -0500 | [diff] [blame] | 36 | }
|
| 37 | } |