
Untitled
By: a guest on
Aug 1st, 2012 | syntax:
None | size: 0.57 KB | hits: 9 | expires: Never
C# Unit testing, using XML from a zip file
// Not sure how to do this
List<byte[]> scripts = GetTheScriptsSomehow();
foreach(var script in scripts )
{
var parsedScript = ScriptParser.Parse(script);
Assert.AreEqual(parsedScript.Blah, "BLAH");
}
ZipInputStream zip = new ZipInputStream(new MemoryStream(Properties.Resources.scripts));
while (zip.GetNextEntry() != null)
{
MemoryStream data = new MemoryStream();
zip.CopyTo(data);
data.Position = 0;
string scriptContents = new StreamReader(data).ReadToEnd();
/// do something with scriptContents variable
}