TestResources.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. using System.IO;
  2. using NUnit.Framework;
  3. namespace Google.ProtocolBuffers.Compatibility
  4. {
  5. static class TestResources
  6. {
  7. public static byte[] google_message1
  8. {
  9. get
  10. {
  11. Stream resource = typeof(TestResources).Assembly.GetManifestResourceStream(
  12. typeof(TestResources).Namespace + ".google_message1.dat");
  13. Assert.NotNull(resource);
  14. byte[] bytes = new byte[resource.Length];
  15. int amtRead = resource.Read(bytes, 0, bytes.Length);
  16. Assert.AreEqual(bytes.Length, amtRead);
  17. return bytes;
  18. }
  19. }
  20. public static byte[] google_message2
  21. {
  22. get
  23. {
  24. Stream resource = typeof(TestResources).Assembly.GetManifestResourceStream(
  25. typeof(TestResources).Namespace + ".google_message2.dat");
  26. Assert.NotNull(resource);
  27. byte[] bytes = new byte[resource.Length];
  28. int amtRead = resource.Read(bytes, 0, bytes.Length);
  29. Assert.AreEqual(bytes.Length, amtRead);
  30. return bytes;
  31. }
  32. }
  33. }
  34. }