public void T03_PipeStages()
{
// setup the pipe...
PipeStagePartition p =
new PipeStagePartition("username",
new PipeStagePartition("tablename",
new PipeStageEnd()
)
);
// setup the HDF context
PipeHdfContext ctx = new PipeHdfContext();
ctx.setQualifier("username", "jeske");
{
bool err = false;
// process the HDF context, should be an error because "table" doesn't exist..
try {
p.generateRowFromContext(ctx);
} catch (PipeGenerateException) {
err = true;
}
Assert.AreEqual(true, err, "error on pipe element not in context");
}
// add the "tablename" key
ctx.setQualifier("tablename", "foo");
// process the HDF context, should be an error because "table" doesn't exist..
PipeRowQualifier newrow = p.generateRowFromContext(ctx);
// test the key produced
Assert.AreEqual("/=jeske/=foo", newrow.ToString());
}