- mhtmllib_src.zip
- Rilling.MhtmlLib
- docs
- api
- design
- ClassDiagram.vsd
- tutorials
- MhtmlLib.sln
- src
- Rilling.Web.Mhtml.TestHarness
- Rilling.Web.Mhtml.TestHarness_old
- Rilling.Web.Mhtml.TestSite
- Rilling.Web.Mhtml
- WinCapture
- mhtmllib_demo.zip
|
using System;
using System.IO;
using Rilling.Web.Mhtml.IO;
using NUnit.Framework;
namespace Rilling.Web.Mhtml.TestHarness
{
[TestFixture()]
public class MhtmlTextWriterTest
{
[Test()]
public void WriteMessageHeader1_MethodTest()
{
MemoryStream mhtBase = new MemoryStream();
MhtmlTextWriter writer = new MhtmlTextWriter( mhtBase );
writer.WriteMessageHeader("MIME Version", "1.0");
writer.Flush();
//mhtBase.Seek(0, SeekOrigin.Begin);
StreamReader reader = new StreamReader( mhtBase );
string testValue = reader.ReadLine();
Assertion.AssertEquals("MIME Version: 1.0", testValue);
}
[Test()]
public void WriteMessageHeader2_WithoutParams_MethodTest()
{
MemoryStream mhtBase = new MemoryStream();
HeaderParameter hp1 = new HeaderParameter("charset", "us-ascii");
HeaderParameter hp2 = new HeaderParameter("boundary", "__myboundary__");
MhtmlTextWriter writer = new MhtmlTextWriter( mhtBase );
writer.WriteMessageHeader("Content-Type", "text/html", hp1, hp2);
StreamReader reader = new StreamReader( mhtBase );
string testValue = reader.ReadLine();
Assertion.AssertEquals("Content-Type: text/html", testValue);
testValue = reader.ReadLine();
Assertion.AssertEquals("\tcharset=\"us-ascii\";", testValue);
testValue = reader.ReadLine();
Assertion.AssertEquals("\tboundary=\"__myboundary__\"", testValue);
}
[Test()]
public void WriteMessageHeader2_MethodTest()
{
}
[Test()]
public void WriteMessageHeader3_MethodTest()
{
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.