From 0da4a89c971b51f814f9dbe76a1dca47f5b440b4 Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Thu, 9 Jul 2015 08:16:21 +0100 Subject: [PATCH] Knock-on effects of moving GetSampleMessage. --- .../ProtocolBuffers.Test/GeneratedMessageTest.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/csharp/src/ProtocolBuffers.Test/GeneratedMessageTest.cs b/csharp/src/ProtocolBuffers.Test/GeneratedMessageTest.cs index 8c9e05147f..8cee98207a 100644 --- a/csharp/src/ProtocolBuffers.Test/GeneratedMessageTest.cs +++ b/csharp/src/ProtocolBuffers.Test/GeneratedMessageTest.cs @@ -603,7 +603,7 @@ namespace Google.Protobuf [Test] public void Reflection_GetValue() { - var message = GetSampleMessage(); + var message = SampleMessages.CreateFullTestAllTypes(); var fields = message.Fields; Assert.AreEqual(message.SingleBool, fields[TestAllTypes.SingleBoolFieldNumber].GetValue(message)); Assert.AreEqual(message.SingleBytes, fields[TestAllTypes.SingleBytesFieldNumber].GetValue(message)); @@ -647,7 +647,7 @@ namespace Google.Protobuf [Test] public void Reflection_Clear() { - var message = GetSampleMessage(); + var message = SampleMessages.CreateFullTestAllTypes(); var fields = message.Fields; fields[TestAllTypes.SingleBoolFieldNumber].Clear(message); fields[TestAllTypes.SingleInt32FieldNumber].Clear(message); @@ -657,7 +657,7 @@ namespace Google.Protobuf fields[TestAllTypes.SingleForeignMessageFieldNumber].Clear(message); fields[TestAllTypes.RepeatedDoubleFieldNumber].Clear(message); - var expected = new TestAllTypes(GetSampleMessage()) + var expected = new TestAllTypes(SampleMessages.CreateFullTestAllTypes()) { SingleBool = false, SingleInt32 = 0, @@ -680,7 +680,7 @@ namespace Google.Protobuf public void Reflection_SetValue_SingleFields() { // Just a sample (primitives, messages, enums, strings, byte strings) - var message = GetSampleMessage(); + var message = SampleMessages.CreateFullTestAllTypes(); var fields = message.Fields; fields[TestAllTypes.SingleBoolFieldNumber].SetValue(message, false); fields[TestAllTypes.SingleInt32FieldNumber].SetValue(message, 500); @@ -690,7 +690,7 @@ namespace Google.Protobuf fields[TestAllTypes.SingleForeignMessageFieldNumber].SetValue(message, new ForeignMessage { C = 12345 }); fields[TestAllTypes.SingleDoubleFieldNumber].SetValue(message, 20150701.5); - var expected = new TestAllTypes(GetSampleMessage()) + var expected = new TestAllTypes(SampleMessages.CreateFullTestAllTypes()) { SingleBool = false, SingleInt32 = 500, @@ -707,7 +707,7 @@ namespace Google.Protobuf [Test] public void Reflection_SetValue_SingleFields_WrongType() { - var message = GetSampleMessage(); + var message = SampleMessages.CreateFullTestAllTypes(); var fields = message.Fields; Assert.Throws(() => fields[TestAllTypes.SingleBoolFieldNumber].SetValue(message, "This isn't a bool")); } @@ -723,7 +723,7 @@ namespace Google.Protobuf [Test] public void Reflection_SetValue_RepeatedFields() { - var message = GetSampleMessage(); + var message = SampleMessages.CreateFullTestAllTypes(); var fields = message.Fields; Assert.Throws(() => fields[TestAllTypes.RepeatedDoubleFieldNumber].SetValue(message, new double[10])); } @@ -731,7 +731,7 @@ namespace Google.Protobuf [Test] public void Reflection_GetValue_IncorrectType() { - var message = GetSampleMessage(); + var message = SampleMessages.CreateFullTestAllTypes(); Assert.Throws(() => message.Fields[TestAllTypes.SingleBoolFieldNumber].GetValue(new TestMap())); } }