Clover.NET coverage report - Coverage

Coverage timestamp: viernes, 12 de agosto de 2005 12:53:38 PM

File Stats: LOC: 41   Methods: 1
NCLOC: 25 Classes: 1
 
Source File Conditionals Statements Methods TOTAL
Helper\ResourceHelper.cs 0,0 % 0,0 % 0,0 % 0,0 %
coverage
1   using System.IO;
2   using System.Reflection;
3   using log4net;
4  
5   namespace ShowX.Helper
6   {
7   /// <summary>
8   /// ResourceHelper ease working with embedded ShowX resources.
9   /// </summary>
10   public class ResourceHelper
11   {
12   private static readonly ILog log = LogManager.GetLogger(
13   typeof(ResourceHelper));
14  
15   /// <summary>
16   /// Write a certain resource to the target file.
17   /// </summary>
18   /// <param name="assembly">Assemble where to look for resource.</param>
19   /// <param name="resource">Resource to write to.</param>
20   /// <param name="filename">File where to save resource.</param>
21 0 public static void WriteResourceToFile(Assembly assembly, string resource,
22   string filename)
23   {
24   log.Info(string.Format("Writing resource '{0}' to file '{1}'. Reading from"
25   + " assembly {2}",resource,filename,assembly.GetName()));
26  
27   Stream resStream = assembly.GetManifestResourceStream(
28   resource);
29  
30   BinaryReader reader = new BinaryReader(resStream);
31   FileStream fs = new FileStream(filename,FileMode.Create);
32  
33   for(int i=0; i < resStream.Length; i++)
34   fs.WriteByte(reader.ReadByte());
35  
36   fs.Close();
37   log.Info("Done");
38   }
39   }
40   }
41