How to unit test this method
-
Say I create a unit test that looks something like this below (autogenerated by VS) to test: [TestMethod()] public void UniContexPipeDataTest() { IResponse response = null; // TODO: Initialize to an appropriate value ISeries series = null; // TODO: Initialize to an appropriate value DateTime asof = new DateTime(); // TODO: Initialize to an appropriate value UniContext target = new UniContext(response, series, asof); target.PipeData(); Assert.Inconclusive("TODO: Implement code to verify target"); } I know I have to initialize response and series but they are big and have lots of other objects and Interfaces embedded within them that need to be instantiated for the UniContext contructor and PipeData() to work correctly. Q. How do I get the interfaces ready so that the constructor and method PipeData() pass in this unit test? Right now I can create these objects and interfaces to pass into the target but they will be empty. Both IResponse and ISeries have tons of embedded interfaces and other things like other objects and properties inside them that need to be created and instantiated with data. Do I need to start with the embedded object first and then do a ordered test unit test type deal? Do I need to learn about stubs, external dependencies and creating mocks objects? Any help/advice on this will be appreciated. --------------------------------------------------------------------------------