public void Get_FromTypeAssemblyUsingNamespace()
 {
     using (var s = new StreamReader(EmbeddedResource.Get <EmbeddedResourceTest>("EmbeddedResourceTest.txt", true)))
         Assert.AreEqual(CONTENTS, s.ReadToEnd());
 }
Example #2
0
 public void Constructor_Stream_StreamIsClosed()
 {
     using (var s = EmbeddedResource.Get <TemporaryFileTest>("EmbeddedResourceTest.txt"))
         using (var file = new TemporaryFile(s))
             Assert.False(s.CanRead, "Stream should be closed.");
 }
 public void Get_FromTypeAssembly()
 {
     using (var s = new StreamReader(EmbeddedResource.Get <EmbeddedResourceTest>("Geekality.IO.EmbeddedResourceTest.txt", false)))
         Assert.AreEqual(CONTENTS, s.ReadToEnd());
 }
Example #4
0
 public void Constructor_Stream_FileIsInitializedWithStreamContents()
 {
     using (var s = EmbeddedResource.Get <TemporaryFileTest>("EmbeddedResourceTest.txt"))
         using (var file = new TemporaryFile(s))
             Assert.AreEqual(EmbeddedResourceTest.CONTENTS, File.ReadAllText(file));
 }