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.")]
|
| 26 | public override void Message2OptimizeSizeReadPerf()
|
| 27 | {
|
| 28 | base.Message2OptimizeSizeReadPerf();
|
| 29 | }
|
| 30 | [Test, Explicit, Description("This test can take a very long time to run.")]
|
| 31 | public override void Message2OptimizeSpeedReadPerf()
|
| 32 | {
|
| 33 | base.Message2OptimizeSpeedReadPerf();
|
| 34 | }
|
| 35 |
|
| 36 | [Test, Explicit, Description("This test can take a very long time to run.")]
|
| 37 | public override void RoundTripMessage2OptimizeSize()
|
| 38 | {
|
| 39 | base.RoundTripMessage2OptimizeSize();
|
| 40 | }
|
| 41 |
|
| 42 | [Test, Explicit, Description("This test can take a very long time to run.")]
|
| 43 | public override void RoundTripMessage2OptimizeSpeed()
|
| 44 | {
|
| 45 | base.RoundTripMessage2OptimizeSpeed();
|
| 46 | }
|
| 47 |
|
| 48 | [Test, Explicit, Description("This test can take a very long time to run.")]
|
| 49 | public override void Message2OptimizeSizeWriterPerf()
|
| 50 | {
|
| 51 | base.Message2OptimizeSizeWriterPerf();
|
| 52 | }
|
| 53 | [Test, Explicit, Description("This test can take a very long time to run.")]
|
| 54 | public override void Message2OptimizeSpeedWriterPerf()
|
| 55 | {
|
| 56 | base.Message2OptimizeSpeedWriterPerf();
|
| 57 | }
|
| 58 |
|
| 59 | }
|
| 60 | } |