Ok I have a basic understanding of the MbUnit Framework, and how to access private data members. I need some help understanding a good approach to testing my design. The examples I have looked at in the documentation and in responses to this news group have to do with using an instance of the Class (MyClass _classObject = new MyClass()). Well in my design I am using the singleton pattern which of course necesitates a single static instance (MySingleton onlyInstance = MySingleton.Instance() ). Now the real problem is I wanted this library to be very self contained. I am only exposing two public methods one for the Instance() and the other for a Logging function, everything else is private or protected (the constructor). The constructor then has the guts of the code, in other words when the constructor is called by the Instance() method it will then populate the private data members of the class through the use of private methods. The end result is that when the constructor has finished constructing the instance it is fully populated. So then how should I go about testing my private methods.. when to get an instance or even calling the constructor runs them already. Perhaps this is not the best design, but for my needs this is what I came up with. Can anyone lend some ideas how I might code the testware for this one?
The basic idea behind this code is: A C# library that a a client can use in their own C# program to track usage information, there is a public method to grab an instance (static) and a Logging method. Everything else is self contained from the client user. (I use Reflection and StackFrame inside the private methods, as well as Database connection code, and IsolatedStorage manipulation) I will be glad to entertain any reasonable idea (including changing my design) Please Help Thanks -SteveM --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "MbUnit.User" 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/MbUnitUser?hl=en -~----------~----~----~----~------~----~------~--~---
