diff options
author | Jon Skeet <jonskeet@google.com> | 2015-07-09 08:16:21 +0100 |
---|---|---|
committer | Jon Skeet <jonskeet@google.com> | 2015-07-09 08:26:07 +0100 |
commit | 0da4a89c971b51f814f9dbe76a1dca47f5b440b4 (patch) | |
tree | 439cc2d2ff26a66212f7270e7301b854c64bb238 /csharp/src/ProtocolBuffers.Test/GeneratedMessageTest.cs | |
parent | 14f2222a50a18ff0d8772095587b9cdad455a7bb (diff) | |
download | protobuf-0da4a89c971b51f814f9dbe76a1dca47f5b440b4.tar.gz protobuf-0da4a89c971b51f814f9dbe76a1dca47f5b440b4.tar.bz2 protobuf-0da4a89c971b51f814f9dbe76a1dca47f5b440b4.zip |
Knock-on effects of moving GetSampleMessage.
Diffstat (limited to 'csharp/src/ProtocolBuffers.Test/GeneratedMessageTest.cs')
-rw-r--r-- | csharp/src/ProtocolBuffers.Test/GeneratedMessageTest.cs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/csharp/src/ProtocolBuffers.Test/GeneratedMessageTest.cs b/csharp/src/ProtocolBuffers.Test/GeneratedMessageTest.cs index 8c9e0514..8cee9820 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<InvalidCastException>(() => 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<InvalidOperationException>(() => 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<InvalidCastException>(() => message.Fields[TestAllTypes.SingleBoolFieldNumber].GetValue(new TestMap()));
}
}
|