private static void GetMonthlyStatementDate(ICRMCoreService cRMCoreAccountService) { cRMCoreAccountService.GetMonthlyStatementDate(Arg.Is <string>(p => p == "A9DFB55A-2FF9-4D79-B666-04892FBC9CD1")) .Returns( new AvailableDates() { StartDate = "2017-01-01", EndDate = "2017-07-01" }); cRMCoreAccountService.GetMonthlyStatementDate( Arg.Is <string>(m => m == "A9DFB55A-2FF9-4D79-B666-04892FBC9CD5")) .Returns((AvailableDates)null); cRMCoreAccountService.When( m => m.GetMonthlyStatementDate(Arg.Is <string>(p => p == "A9DFB55A-2FF9-4D79-B666-04892FBC9CD6"))) .Do( x => { throw new GdErrorException( "Error while executing GetMonthlyStatementDate A9DFB55A-2FF9-4D79-B666-04892FBC9CD6"); }); cRMCoreAccountService.When( m => m.GetMonthlyStatementDate(Arg.Is <string>(p => p == "A9DFB55A-2FF9-4D79-B666-04892FBC9CD7"))) .Do( x => { throw new Exception("Error while executing GetMonthlyStatementDate A9DFB55A-2FF9-4D79-B666-04892FBC9CD7"); }); }