What does GetData do? You probably need to stub that out, but without knowing what it does, I can't say for sure.
--- Patrick Steele http://weblogs.asp.net/psteele On Wed, Nov 9, 2011 at 11:20 AM, Laksh <[email protected]> wrote: > 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. > > -- 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.
