If you need to mock XElement perhaps you could create an XElementDecorator where the members and properties are set up to use the underlying XElement as a backing store and then mark the members virtual in the decorator itself (which would facilitate the ability to mock). This would allow you to do what you need to do except there is a bit of overhead in converting these elements to and from the decorator type which could prove to be a pain altogether. Maybe if you used an implicit operator to convert between XElement and XElementDecorator that would alleviate some of the overhead but not all of it.
On 10 May 2011 13:50, bill richards <[email protected]> wrote: > > That isn't your decision and you do not have all the facts to make that > > decision. Kindly keep your opinions to yourself about how others do > > their development. > > Further to Patrick's note about rudeness ... if it is nobody's > business and opinions are not worth sharing, why would you pose your > question in the first place? > > As it happens, I do have ALL THE FACTS which are PERTINENT to this > question, what with me being a competent .Net developer and all, and > what with my (quite in depth) understanding of the mocking framework, > a topic upon which YOU have ASKED FOR HELP. > > My response is exactly the HELP that you needed. DO NOT mock the > XElement, 1) because there is no need, and 2) because you can't. > > Be advised that when you ask for help int he future, you might not get > the answer you were looking for (because clearly you already knew the > answer and were just looking for validation), but this is no reason to > be rude to someone offering you the benefit of their expertise without > you having to pay for it. > > Thanks. > > -- > 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.
