private static void GetAccountDetail(ICRMCoreService cRMCoreAccountService) { cRMCoreAccountService.GetAccountDetail(Arg.Is <string>(p => p == "6177A1C3-C17A-4E7C-83CD-A2D4CA62CDC1")) .Returns(new AccountDetail() { State = "State 1", Stage = "Stage 1", Association = "Association 1", CardExternalID = "1111111", AccountExternalID = "111111", Cure = "Cure 1", Processor = "Preocessor 1", Reason = "Reason", AccountNumber = "1111111111" }); cRMCoreAccountService.GetAccountDetail(Arg.Is <string>(p => p == "6177A1C3-C17A-4E7C-83CD-A2D4CA62CDC2")) .Returns(new AccountDetail() { State = "State 2", Stage = "Stage 2", Association = "Association 2", CardExternalID = "1111112", AccountExternalID = "111112", Cure = "Cure 2", Processor = "Preocessor 2", AccountNumber = "1111111112" }); cRMCoreAccountService.GetAccountDetail(Arg.Is <string>(p => p == "6177A1C3-C17A-4E7C-83CD-A2D4CA62CDC3")) .Returns(new AccountDetail() { State = "State 3", Stage = "Stage 3", Association = "Association 3", AccountExternalID = "111113", Cure = "Cure 3", Processor = "Preocessor 3", Reason = "Reason", AccountNumber = "1111111113" }); cRMCoreAccountService.GetAccountDetail( Arg.Is <string>(p => p == "04C9E5B5716A43C2B55DD4B351C0AA87")) .Returns((AccountDetail)null); cRMCoreAccountService.When( m => m.GetAccountDetail(Arg.Is <string>(p => p == "04C9E5B5716A43C2B55DD4B351C0AA89"))) .Do( x => { throw new GdErrorException( "Error while executing GetCustomerDetail 04C9E5B5716A43C2B55DD4B351C0AA89"); }); cRMCoreAccountService.When( m => m.GetAccountDetail(Arg.Is <string>(p => p == "04C9E5B5716A43C2B55DD4B351C0AA88"))) .Do( x => { throw new Exception("Error while executing GetAccountDetail 04C9E5B5716A43C2B55DD4B351C0AA88"); }); }