locked
Should I shim out methods inside my tested method? RRS feed

  • Question

  • If I'm going to test this method below, would I just need to shim out the two method calls inside my tested method or should my test run these two methods (PreviousQuarterEnd, ResolveDate)and get their values to complete my test?

    public override DateTime ResolveDate(ISeries comparisonSeries, DateTime targetDate)
            {
                switch (comparisonSeries.Key)
                {
                    case SeriesKey.SomeKey1:
                    case SeriesKey.SomeKey2:
                    case SeriesKey.SomeKey3:
                    case SeriesKey.SomeKey4:
                    case SeriesKey.SomeKey5:
                        return DateHelper.PreviousOrCurrentQuarterEnd(targetDate);
                    default:
                        break;
                }
    
                return base.ResolveDate(comparisonSeries, targetDate);
            }


    chuckdawit




    • Edited by witdaj Friday, May 31, 2013 4:33 PM
    Friday, May 31, 2013 4:12 PM

Answers