void ExternalAuthorization(string accessPointToken, string credentialToken, string reason, Decision decision)
        {
            PACSPortClient client = PACSPortClient;

            RunStep(
                () =>
                { PACSPortClient.ExternalAuthorization(accessPointToken, credentialToken, reason, decision); },
                "External Authorizaton");
            DoRequestDelay();
        }
        public void ExternalAuthorizationInvalidTokenTest()
        {
            RunTest(() =>
            {
                PACSPortClient client = PACSPortClient;

                string token = Guid.NewGuid().ToString().Substring(0, 8);
                RunStep(
                    () => { PACSPortClient.ExternalAuthorization(token, null, "Test Access Granted", Decision.Granted); },
                    "External Authorization with invalid token",
                    OnvifFaults.NotFound,
                    true);
            });
        }
        public void ExternalAuthorizationCommandNotSupportedTest()
        {
            RunTest(() =>
            {
                List <AccessPointInfo> accessPointInfos = GetAccessPointInfoList();

                List <AccessPointInfo> filtered =
                    accessPointInfos.Where(API =>
                                           API.Capabilities != null &&
                                           !(API.Capabilities.ExternalAuthorizationSpecified &&
                                             API.Capabilities.ExternalAuthorization)).ToList();

                foreach (AccessPointInfo info in filtered)
                {
                    RunStep(
                        () => { PACSPortClient.ExternalAuthorization(info.token, null, "Test Access Granted", Decision.Granted); },
                        "External Authorization", "Receiver/ActionNotSupported/NotSupported", true);
                }
            });
        }