Ejemplo n.º 1
0
        private void GetAccountStatusReason(ICRMCoreService cRMCoreAccountService)
        {
            cRMCoreAccountService
            .GetStatusTransition(Arg.Is <GetStatusTransitionRequest>
                                     (p => p.AccountIdentifier == "18204E5C-C243-4096-8BC2-3A62E49B687C"))
            .Returns(new GetStatusTransitionResponse
            {
                CurrentStatus       = "Active",
                CurrentStatusReason = null,
                TargetStatuses      = new List <string> {
                    "Restricted", "Locked"
                },
                ReasonKey    = 54,
                StatusReason = "Agent Manual Review",
            });

            cRMCoreAccountService.When(m => m.GetStatusTransition(Arg.Is <GetStatusTransitionRequest>
                                                                      (p => p.AccountIdentifier == "18204E5C-C243-4096-8BC2-3A62E49B687D")))
            .Do(
                x =>
            {
                throw new ArgumentException();
            });

            cRMCoreAccountService.When(m => m.GetStatusTransition(Arg.Is <GetStatusTransitionRequest>
                                                                      (p => p.AccountIdentifier == "18204E5C-C243-4096-8BC2-3A62E49B687E")))
            .Do(
                x =>
            {
                throw new GdErrorException(
                    "Error while executing GetAccountStatusReason");
            });

            cRMCoreAccountService
            .GetStatusTransition(Arg.Is <GetStatusTransitionRequest>
                                     (p => p.AccountIdentifier == "18204E5C-C243-4096-8BC2-3A62E49B687F"))
            .Returns((GetStatusTransitionResponse)null);
        }