public void OpenTextReader_from_embedded_resource_content_qualified_by_type()
        {
            var content = new ContentEmbeddedResource("SampleResource.txt", GetType());

            using (var reader = content.OpenTextReader())
            {
                var actual = reader.ReadToEnd();
                Assert.AreEqual("Hello World!", actual);
            }
        }
        public void OpenTextReader_from_embedded_resource_content_with_qualified_name()
        {
            var content = new ContentEmbeddedResource("Gallio.Tests.Common.IO.SampleResource.txt", GetType());

            using (var reader = content.OpenTextReader())
            {
                var actual = reader.ReadToEnd();
                Assert.AreEqual("Hello World!", actual);
            }
        }
        public void OpenTextReader_from_embedded_resource_content_qualified_by_codeElementInfo()
        {
            var content = new ContentEmbeddedResource("SampleResource.txt", null);
            content.CodeElementInfo = Reflector.Wrap(GetType());

            using (var reader = content.OpenTextReader())
            {
                var actual = reader.ReadToEnd();
                Assert.AreEqual("Hello World!", actual);
            }
        }
 public void OpenTextReader_from_embedded_resource_not_found_should_throw_exception()
 {
     var content = new ContentEmbeddedResource("SomeInvalidResource", null);
     Assert.Throws<PatternUsageErrorException>(() => content.OpenTextReader());
 }