I have the following method. I'm creating a instance of Package class
inside the method, setting some of its proeprties and then returning
it. How do i unit test this method using Rhino?
public class Manifest : IManifest<Package>
{
private IContext _context = null;
publicManifest(IContext context)
{
_context = context;
}
public Package BuildManifest()
{
// Data object is class which holds the data from
datasource.
DataObject data = GetData(_context);
Package package = new Package();
package.BatchID = data.BatchId;
package.Title = data.Title;
package.Name = data.Name;
package.City = data.City;
IList<PackageDocument> documents = new
List<PackageDocument>();
foreach (Document document in data.ConvertedDocuments)
{
PackageDocument packageDocument = new
PackageDocument();
packageDocument.FileName = document.DocumentName;
packageDocument.PrintOrder =
document.SequenceNumber.Value;
packageDocument.PaperType =
PackageDocumentPaperType.White;
documents.Add(packageDocument);
}
package.Documents = documents.ToArray();
return package;
}
}
--
You received this message because you are subscribed to the Google Groups
"Rhino.Mocks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rhinomocks?hl=en.