private static void GetCustomerDetail(ICRMCoreService cRMCoreAccountService) { cRMCoreAccountService.GetCustomerDetail(Arg.Is <string>(p => p == "6177A1C3-C17A-4E7C-83CD-A2D4CA62CDC1")) .Returns(new CustomerDetail() { Address = new Address() { Address1 = "Address1", Address2 = "Address2", City = "City 1", Country = "Country1", ZipCode = "ZipCode 1", State = "State 1", County = "County 1" }, AccountExternalID = "111111", DOB = "2017/05/10", FirstName = "Roman", MiddleName = "MiddleName1", LastName = "Zhang", Last4SSN = "1231", SSNToken = "123456", CreateDate = DateTime.Now.AddMonths(-1).Date }); cRMCoreAccountService.GetCustomerDetail(Arg.Is <string>(p => p == "6177A1C3-C17A-4E7C-83CD-A2D4CA62CDC2")) .Returns(new CustomerDetail() { AccountExternalID = "111112", DOB = "2017/05/10", FirstName = "Roman", MiddleName = "", LastName = "Zhang", Last4SSN = "1232", SSNToken = "123456", CreateDate = DateTime.Now.AddMonths(-2).Date }); cRMCoreAccountService.GetCustomerDetail(Arg.Is <string>(p => p == "6177A1C3-C17A-4E7C-83CD-A2D4CA62CDC3")) .Returns(new CustomerDetail() { Address = new Address() { City = "City 3", Country = "Country3", ZipCode = "ZipCode 3", State = "State 3", County = "County 3" }, AccountExternalID = "111113", DOB = "2017/05/10", FirstName = "Roman", LastName = "Zhang", Last4SSN = "1233", SSNToken = "123456" }); cRMCoreAccountService.GetCustomerDetail( Arg.Is <string>(p => p == "04C9E5B5716A43C2B55DD4B351C0AA87")) .Returns((CustomerDetail)null); cRMCoreAccountService.When( m => m.GetCustomerDetail(Arg.Is <string>(p => p == "04C9E5B5716A43C2B55DD4B351C0AA89"))) .Do( x => { throw new GdErrorException( "Error while executing GetCustomerDetail 04C9E5B5716A43C2B55DD4B351C0AA89"); }); cRMCoreAccountService.When( m => m.GetCustomerDetail(Arg.Is <string>(p => p == "04C9E5B5716A43C2B55DD4B351C0AA88"))) .Do( x => { throw new Exception("Error while executing GetCustomerDetail 04C9E5B5716A43C2B55DD4B351C0AA88"); }); }