protected override void InternalProcessRecord()
        {
            string text;
            string text2;
            bool   flag  = base.ValidateAutoDiscover(out text, out text2);
            string text3 = null;

            WebServicesTestOutcome.TestScenario scenario = this.LightMode.IsPresent ? WebServicesTestOutcome.TestScenario.EwsConvertId : WebServicesTestOutcome.TestScenario.EwsGetFolder;
            if (base.IsFromAutoDiscover)
            {
                if (string.IsNullOrEmpty(text))
                {
                    base.OutputSkippedOutcome(scenario, Strings.InformationSkippedEws);
                }
                else
                {
                    text3 = text;
                    base.WriteVerbose(Strings.VerboseTestEwsFromAutoDiscover(text3));
                }
            }
            else
            {
                text3 = base.GetSpecifiedEwsUrl();
                base.WriteVerbose(Strings.VerboseTestEwsFromParameter(text3));
            }
            if (!string.IsNullOrEmpty(text3))
            {
                EwsValidator ewsValidator = new EwsValidator(text3, base.TestAccount.Credential, base.TestAccount.User.PrimarySmtpAddress.ToString())
                {
                    VerboseDelegate         = new Task.TaskVerboseLoggingDelegate(base.WriteVerbose),
                    UserAgent               = base.UserAgentString,
                    IgnoreSslCertError      = (base.TrustAnySSLCertificate || base.MonitoringContext.IsPresent),
                    Operation               = (this.LightMode.IsPresent ? EwsValidator.RequestOperation.ConvertId : EwsValidator.RequestOperation.GetFolder),
                    PublicFolderMailboxGuid = ((base.TestAccount.User.RecipientTypeDetails == RecipientTypeDetails.PublicFolderMailbox) ? base.TestAccount.User.ExchangeGuid : Guid.Empty)
                };
                flag = ewsValidator.Invoke();
                WebServicesTestOutcome outcome = new WebServicesTestOutcome
                {
                    Scenario            = scenario,
                    Source              = base.LocalServer.Fqdn,
                    Result              = (flag ? CasTransactionResultEnum.Success : CasTransactionResultEnum.Failure),
                    Error               = string.Format("{0}", ewsValidator.Error),
                    ServiceEndpoint     = TestWebServicesTaskBase.FqdnFromUrl(text3),
                    Latency             = ewsValidator.Latency,
                    ScenarioDescription = TestWebServicesTaskBase.GetScenarioDescription(scenario),
                    Verbose             = ewsValidator.Verbose
                };
                base.Output(outcome);
            }
            base.InternalProcessRecord();
        }
示例#2
0
        protected override void InternalProcessRecord()
        {
            string text  = null;
            string text2 = null;
            bool   flag  = base.ValidateAutoDiscover(out text, out text2);

            if (!base.IsFromAutoDiscover)
            {
                text  = base.GetSpecifiedEwsUrl();
                text2 = this.GetSpecifiedOabUrl();
            }
            if (string.IsNullOrEmpty(text))
            {
                base.OutputSkippedOutcome(WebServicesTestOutcome.TestScenario.ExchangeWebServices, Strings.InformationSkippedEws);
                base.OutputSkippedOutcome(WebServicesTestOutcome.TestScenario.AvailabilityService, Strings.InformationSkippedAsForAutodiscover);
            }
            else
            {
                if (base.IsFromAutoDiscover)
                {
                    base.WriteVerbose(Strings.VerboseTestEwsFromAutoDiscover(text));
                }
                else
                {
                    base.WriteVerbose(Strings.VerboseTestEwsFromParameter(text));
                }
                EwsValidator ewsValidator = new EwsValidator(text, base.TestAccount.Credential)
                {
                    VerboseDelegate    = new Task.TaskVerboseLoggingDelegate(base.WriteVerbose),
                    UserAgent          = base.UserAgentString,
                    IgnoreSslCertError = (base.TrustAnySSLCertificate || base.MonitoringContext.IsPresent)
                };
                flag = ewsValidator.Invoke();
                WebServicesTestOutcome outcome = new WebServicesTestOutcome
                {
                    Scenario            = WebServicesTestOutcome.TestScenario.ExchangeWebServices,
                    Source              = base.LocalServer.Fqdn,
                    Result              = (flag ? CasTransactionResultEnum.Success : CasTransactionResultEnum.Failure),
                    Error               = string.Format("{0}", ewsValidator.Error),
                    ServiceEndpoint     = TestWebServicesTaskBase.FqdnFromUrl(text),
                    Latency             = ewsValidator.Latency,
                    ScenarioDescription = TestWebServicesTaskBase.GetScenarioDescription(WebServicesTestOutcome.TestScenario.ExchangeWebServices),
                    Verbose             = ewsValidator.Verbose
                };
                base.Output(outcome);
                if (flag)
                {
                    EwsValidator ewsValidator2 = new EwsValidator(text, base.TestAccount.Credential)
                    {
                        VerboseDelegate    = new Task.TaskVerboseLoggingDelegate(base.WriteVerbose),
                        UserAgent          = base.UserAgentString,
                        IgnoreSslCertError = (base.TrustAnySSLCertificate || base.MonitoringContext.IsPresent),
                        EmailAddress       = base.TestAccount.User.PrimarySmtpAddress.ToString(),
                        Operation          = EwsValidator.RequestOperation.GetUserAvailability
                    };
                    flag    = ewsValidator2.Invoke();
                    outcome = new WebServicesTestOutcome
                    {
                        Scenario            = WebServicesTestOutcome.TestScenario.AvailabilityService,
                        Source              = base.LocalServer.Fqdn,
                        Result              = (flag ? CasTransactionResultEnum.Success : CasTransactionResultEnum.Failure),
                        Error               = string.Format("{0}", ewsValidator2.Error),
                        ServiceEndpoint     = TestWebServicesTaskBase.FqdnFromUrl(text),
                        Latency             = ewsValidator2.Latency,
                        ScenarioDescription = TestWebServicesTaskBase.GetScenarioDescription(WebServicesTestOutcome.TestScenario.AvailabilityService),
                        Verbose             = ewsValidator2.Verbose
                    };
                    base.Output(outcome);
                }
                else
                {
                    base.OutputSkippedOutcome(WebServicesTestOutcome.TestScenario.AvailabilityService, Strings.InformationSkippedAsForEWS);
                }
            }
            if (string.IsNullOrEmpty(text2))
            {
                base.OutputSkippedOutcome(WebServicesTestOutcome.TestScenario.OfflineAddressBook, Strings.InformationSkippedOab);
            }
            else
            {
                if (base.IsFromAutoDiscover)
                {
                    base.WriteVerbose(Strings.VerboseTestOabFromAutoDiscover(text2));
                }
                else
                {
                    base.WriteVerbose(Strings.VerboseTestOabFromParameter(text2));
                }
                OabValidator oabValidator = new OabValidator(text2, base.TestAccount.Credential)
                {
                    VerboseDelegate    = new Task.TaskVerboseLoggingDelegate(base.WriteVerbose),
                    UserAgent          = base.UserAgentString,
                    IgnoreSslCertError = (base.TrustAnySSLCertificate || base.MonitoringContext.IsPresent)
                };
                flag = oabValidator.Invoke();
                WebServicesTestOutcome outcome2 = new WebServicesTestOutcome
                {
                    Scenario            = WebServicesTestOutcome.TestScenario.OfflineAddressBook,
                    Source              = base.LocalServer.Fqdn,
                    Result              = (flag ? CasTransactionResultEnum.Success : CasTransactionResultEnum.Failure),
                    Error               = string.Format("{0}", oabValidator.Error),
                    ServiceEndpoint     = TestWebServicesTaskBase.FqdnFromUrl(text2),
                    Latency             = oabValidator.Latency,
                    ScenarioDescription = TestWebServicesTaskBase.GetScenarioDescription(WebServicesTestOutcome.TestScenario.OfflineAddressBook),
                    Verbose             = oabValidator.Verbose
                };
                base.Output(outcome2);
            }
            base.InternalProcessRecord();
        }