aboutsummaryrefslogtreecommitdiff
path: root/src/ProtocolBuffers.Test/Compatibility/TestResources.cs
diff options
context:
space:
mode:
authorcsharptest <roger@csharptest.net>2011-10-01 15:54:22 -0500
committerrogerk <devnull@localhost>2011-10-01 15:54:22 -0500
commit2e89071876750487160fef06295143837d571cd1 (patch)
treec9cad2306571f339c222848f379eb742e6013799 /src/ProtocolBuffers.Test/Compatibility/TestResources.cs
parentb5a7ed241127412d4d9c22c79b3961239bef49e8 (diff)
downloadprotobuf-2e89071876750487160fef06295143837d571cd1.tar.gz
protobuf-2e89071876750487160fef06295143837d571cd1.tar.bz2
protobuf-2e89071876750487160fef06295143837d571cd1.zip
Changed the resource loading in unit tests
Diffstat (limited to 'src/ProtocolBuffers.Test/Compatibility/TestResources.cs')
-rw-r--r--src/ProtocolBuffers.Test/Compatibility/TestResources.cs42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/ProtocolBuffers.Test/Compatibility/TestResources.cs b/src/ProtocolBuffers.Test/Compatibility/TestResources.cs
new file mode 100644
index 00000000..2581c7bf
--- /dev/null
+++ b/src/ProtocolBuffers.Test/Compatibility/TestResources.cs
@@ -0,0 +1,42 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Text;
+using NUnit.Framework;
+
+namespace Google.ProtocolBuffers.Compatibility
+{
+ static class TestResources
+ {
+ public static byte[] google_message1
+ {
+ get
+ {
+ Stream resource = typeof(TestResources).Assembly.GetManifestResourceStream(
+ typeof(TestResources).Namespace + ".google_message1.dat");
+
+ Assert.IsNotNull(resource, "Unable to the locate resource: google_message1");
+
+ byte[] bytes = new byte[resource.Length];
+ int amtRead = resource.Read(bytes, 0, bytes.Length);
+ Assert.AreEqual(bytes.Length, amtRead);
+ return bytes;
+ }
+ }
+ public static byte[] google_message2
+ {
+ get
+ {
+ Stream resource = typeof(TestResources).Assembly.GetManifestResourceStream(
+ typeof(TestResources).Namespace + ".google_message2.dat");
+
+ Assert.IsNotNull(resource, "Unable to the locate resource: google_message2");
+
+ byte[] bytes = new byte[resource.Length];
+ int amtRead = resource.Read(bytes, 0, bytes.Length);
+ Assert.AreEqual(bytes.Length, amtRead);
+ return bytes;
+ }
+ }
+ }
+}