コード例 #1
0
ファイル: Program.cs プロジェクト: Project-Earth-Team/Api
        public static void Main(string[] args)
        {
            TypeDescriptor.AddAttributes(typeof(Uuid), new TypeConverterAttribute(typeof(StringToUuidConv)));

            // Init Logging
            var log = new LoggerConfiguration()
                      .WriteTo.Console()
                      .WriteTo.File("logs/debug.txt", rollingInterval: RollingInterval.Day, rollOnFileSizeLimit: true, fileSizeLimitBytes: 8338607, outputTemplate: "{Timestamp:HH:mm:ss.fff} [{Level:u3}] {Message:lj}{NewLine}{Exception}")
                      .MinimumLevel.Debug()
                      .CreateLogger();

            Log.Logger = log;

            //Initialize state singleton from config
            StateSingleton.Instance.config              = ServerConfig.getFromFile();
            StateSingleton.Instance.catalog             = CatalogResponse.FromFiles(StateSingleton.Instance.config.itemsFolderLocation, StateSingleton.Instance.config.efficiencyCategoriesFolderLocation);
            StateSingleton.Instance.recipes             = Recipes.FromFile(StateSingleton.Instance.config.recipesFileLocation);
            StateSingleton.Instance.settings            = SettingsResponse.FromFile(StateSingleton.Instance.config.settingsFileLocation);
            StateSingleton.Instance.seasonChallenges    = ChallengesResponse.FromFile(StateSingleton.Instance.config.seasonChallengesFileLocation);
            StateSingleton.Instance.productCatalog      = ProductCatalogResponse.FromFile(StateSingleton.Instance.config.productCatalogFileLocation);
            StateSingleton.Instance.tappableData        = TappableUtils.loadAllTappableSets();
            StateSingleton.Instance.activeTappableTypes = new Dictionary <Guid, string>();
            //Start api
            CreateHostBuilder(args).Build().Run();

            Log.Information("Server started!");
        }
コード例 #2
0
ファイル: SettingsController.cs プロジェクト: hotjk/dotconfig
        public HttpResponseMessage Index(
            [System.Web.Mvc.ModelBinder(typeof(Grit.Utility.Web.Json.JsonNetModelBinder))] Envelope envelope)
        {
            var client = ClientService.GetClient(envelope.Id);

            if (client == null)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.NotFound, "Client not found"));
            }

            var decrypted = EnvelopeService.PublicDecrypt(envelope, client.PublicKey);
            var req       = JsonConvert.DeserializeObject <SettingsRequest>(decrypted);

            if (req.Client != envelope.Id)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, "Invalid client"));
            }

            var tree = TreeService.GetTree(Constants.TREE_NODE);
            SettingsResponse settings = NodeService.GetClientSettings(client, tree)
                                        .Filter(req.Pattern);

            string json = JsonConvert.SerializeObject(settings);

            Envelope resp = EnvelopeService.Encrypt(client.Name, json, client.PublicKey);

            return(Request.CreateResponse(HttpStatusCode.OK, resp));
        }
コード例 #3
0
        public SettingsResponse GetSettings()
        {
            var settings = Locator.GetService <MailSnifferSettingsModule>().Settings;
            var manager  = Locator.GetService <UserManagerExt>();

            var responseSettings = new SettingsResponse
            {
                FilterString               = settings.FilterList,
                BlockFilterString          = settings.BlockFilterList,
                IpExceptionUsers           = manager.GetUsersIpAddresses(settings.ExceptionUsers).ToList(),
                MonitorMailsWithAttachment = settings.MonitorMailsWithAttachment
            };

            if (settings.MonitorEmployeesOnProbation)
            {
                responseSettings.IpUsersOnProbation =
                    manager.GetUsersIpAddresses(settings.EmployeesOnProbation).ToList();
            }

            if (settings.MonitorEmployeesOnDismissal)
            {
                responseSettings.IpUsersOnDismissal =
                    manager.GetUsersIpAddresses(settings.EmployeesOnDismissal).ToList();
            }

            return(responseSettings);
        }
コード例 #4
0
 private static SettingsModel MapSettings(SettingsResponse settings)
 {
     return(new SettingsModel
     {
         Theme = (Models.Theme)settings.Theme
     });
 }
コード例 #5
0
        public void MSASRM_S01_TC03_Settings_InvalidXMLBody_ActiveSyncVersionNot141()
        {
            Site.Assume.AreNotEqual <string>("14.1", Common.GetConfigurationPropertyValue("ActiveSyncProtocolVersion", this.Site), "Implementation does consider the XML body of the command request to be invalid, if the protocol version specified by in the command request is not 14.1.");
            Site.Assume.AreNotEqual <string>("16.0", Common.GetConfigurationPropertyValue("ActiveSyncProtocolVersion", this.Site), "Implementation does consider the XML body of the command request to be invalid, if the protocol version specified by in the command request is not 16.0.");
            Site.Assume.AreNotEqual <string>("16.1", Common.GetConfigurationPropertyValue("ActiveSyncProtocolVersion", this.Site), "Implementation does consider the XML body of the command request to be invalid, if the protocol version specified by in the command request is not 16.1.");

            #region The client logs on User1's account, calls Settings command and checks the response of Settings command.

            if (Common.IsRequirementEnabled(418, this.Site))
            {
                SettingsResponse settingsResponse = this.ASRMAdapter.Settings();

                // Add the debug information
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASRM_R418");

                // Verify MS-ASRM requirement: MS-ASRM_R418
                // The value of Status element of Settings response could not be 1, which means the operation is unsuccessful.
                Site.CaptureRequirementIfAreNotEqual <string>(
                    "1",
                    settingsResponse.ResponseData.Status,
                    418,
                    @"[In Appendix B: Product Behavior]Implementation does consider the XML body of the command request to be invalid, if the protocol version that is specified by the command request does not support the XML elements that are defined for this protocol. (Exchange Server 2010 and above follow this behavior.)");
            }

            #endregion
        }
コード例 #6
0
        public SettingsResponse GetClientSettings(Client client, Grit.Tree.Node tree)
        {
            var clientNodes = GetNodes(client.Nodes);
            var allNodes    = GetNodes();

            SettingsResponse resp = new SettingsResponse(client.Name);
            var path = new List <Grit.Tree.Node>(5);

            RijndaelManager rsa = new RijndaelManager(KEY, IV);

            foreach (var node in clientNodes)
            {
                if (node.Entries == null || !node.Entries.Any())
                {
                    continue;
                }
                path.Clear();
                tree.FindByData(node.NodeId, path);

                string strPath = string.Join("/",
                                             path.Select(n => allNodes.FirstOrDefault(x => x.NodeId == n.Data)).Select(n => n.Name).Reverse())
                                 + "/";

                resp.Entries.AddRange(node.Entries.Select(n => new SettingsResponse.Entry {
                    Path = strPath + n.Key, Value = rsa.Decrypt(n.Value)
                }));
            }
            return(resp);
        }
コード例 #7
0
        public SettingsResponse Settings()
        {
            var response = new SettingsResponse
            {
                XDbEnabled = Sitecore.Configuration.Settings.GetBoolSetting("Xdb.Enabled", false)
            };

            return(response);
        }
コード例 #8
0
        private void ReceiveSettingsResponse(byte[] body)
        {
            Log.Trace("Receiving Settings Response",
                      "ReceiveSettingsResponse");

            SettingsResponse response = SettingsResponse.FromBytes(body);

            Session.Settings = response.Settings;
        }
コード例 #9
0
        /// <summary>
        /// Supports get and set operations on global properties and Out of Office (OOF) settings for the user, sends device information to the server, implements the device password/personal identification number (PIN) recovery, and retrieves a list of the user's e-mail addresses.
        /// </summary>
        /// <param name="request">A SettingsRequest object that contains the request information.</param>
        /// <returns>Settings command response</returns>
        public SettingsResponse Settings(SettingsRequest request)
        {
            SettingsResponse response = this.activeSyncClient.Settings(request);

            this.VerifyTransportRequirements();
            this.VerifyWBXMLCapture(CommandName.Settings, response);
            this.VerifySettingsCommand(response);
            return(response);
        }
コード例 #10
0
        public override Task <SettingsResponse> GetSettings(Empty request, ServerCallContext context)
        {
            var response = new SettingsResponse()
            {
                HasMultiplayer = _playFabService.HasCredentials
            };

            return(Task.FromResult(response));
        }
コード例 #11
0
        public async Task <IHttpActionResult> GetSettingByAccountIdAsync(int accountId)
        {
            var response = new SettingsResponse();

            response.SettingsViewModel = await _settingService.GetSettingByAccountIdAsync(accountId);

            response.StatusCode = (int)HttpStatusCode.OK;

            return(Ok(response));
        }
コード例 #12
0
        public static SettingsResponse ToSettingsResponse(this Domain.Settings.Settings settings)
        {
            var settingsResponse = new SettingsResponse();

            if (settings != null)
            {
                settingsResponse.Id          = settings.Id;
                settingsResponse.RawSettings = settings.RawSettings;
                settingsResponse.ChannelId   = settings.ChannelId;
            }
            return(settingsResponse);
        }
コード例 #13
0
        private void ReceiveSettingsRequest(byte[] body, ulong senderId)
        {
            Log.Trace("Receiving Settings Request", "ReceiveConcealRequest");

            SettingsRequest request = SettingsRequest.FromBytes(body);

            SettingsResponse response = new SettingsResponse()
            {
                Settings = Settings.Instance
            };

            response.SendToPlayer(senderId);
        }
コード例 #14
0
        public void TestUpdateBillingSettings()
        {
            _settingsService.UpdateRecurringBilling(MerchantId, true);

            SettingsResponse settings = _settingsService.GetSettings(MerchantId);

            Assert.AreEqual("True", settings.orderSetting.optInForRecurringBilling);

            _settingsService.UpdateRecurringBilling(MerchantId, false);

            settings = _settingsService.GetSettings(MerchantId);
            Assert.AreEqual("False", settings.orderSetting.optInForRecurringBilling);
        }
コード例 #15
0
        public void TestUpdateBillingSettings()
        {
            _settingsService.UpdateRecurringBilling(Configuration.MerchantId, true);

            SettingsResponse settings = _settingsService.GetSettings(Configuration.MerchantId);

            Assert.AreEqual(true, settings.orderSetting.optInForRecurringBilling);

            _settingsService.UpdateRecurringBilling(Configuration.MerchantId, true);

            settings = _settingsService.GetSettings(Configuration.MerchantId);
            Assert.AreEqual(false, settings.orderSetting.optInForRecurringBilling);
        }
コード例 #16
0
        /// <summary>
        /// Gets the RightsManagementInformation by Settings command.
        /// </summary>
        /// <returns>The Settings response which is returned from server.</returns>
        public SettingsResponse Settings()
        {
            SettingsRequest request = new SettingsRequest();

            Request.SettingsRightsManagementInformation settingsInformation = new Request.SettingsRightsManagementInformation();
            Request.SettingsUserInformation             setUser             = new Request.SettingsUserInformation {
                Item = string.Empty
            };
            settingsInformation.Get = string.Empty;
            request.RequestData.RightsManagementInformation = settingsInformation;
            request.RequestData.UserInformation             = setUser;
            SettingsResponse response = this.activeSyncClient.Settings(request);

            Site.Assert.IsNotNull(response, "If the command is successful, the response should not be null.");
            this.VerifyWBXMLCapture();
            this.VerifySettingsResponse(response);
            return(response);
        }
コード例 #17
0
        public IHttpActionResult GetSettings(string externalUserId)
        {
            var settings = this.usersRepository.GetUserSettings(externalUserId);
            var result   = new SettingsResponse();

            if (settings == null)
            {
                result.AreNotificationsOn = true;
                result.Time = 60;
            }
            else
            {
                result.AreNotificationsOn = settings.ShowNotyfications;
                result.Time = settings.TimeBeforeNotification;
            }

            return(Ok(result));
        }
コード例 #18
0
        public async Task <IActionResult> GetSettings()
        {
            var employeeId = User.GetEmployeeId();
            var merchantId = User.GetMerchantId();

            try
            {
                var merchant = await _payMerchantClient.Api.GetByIdAsync(merchantId);

                var publicKeyInfo = await _payAuthClient.GetPayAuthInformationAsync(merchantId);

                var baseAssetId = await _assetService.GetBaseAssetId(merchantId);

                var availableBaseAssets = (await _assetService.GetSettlementAssetsAsync(merchantId)).ToDictionary(_ => _.Key, _ => _.Value);

                // need to add base asset if not empty to the list of available assets
                if (!string.IsNullOrEmpty(baseAssetId) && !availableBaseAssets.ContainsKey(baseAssetId))
                {
                    Asset asset = await _lykkeAssetsResolver.TryGetAssetAsync(baseAssetId);

                    availableBaseAssets.TryAdd(baseAssetId, asset?.DisplayId ?? baseAssetId);
                }

                var settings = new SettingsResponse
                {
                    MerchantDisplayName = merchant.DisplayName,
                    EmployeeFullname    = User.GetName(),
                    EmployeeEmail       = User.GetEmail(),
                    AvailableBaseAssets = availableBaseAssets.Select(o => new AssetItemViewModel(o.Key, o.Value)).ToList().OrderBy(_ => _.Title),
                    BaseAssetId         = baseAssetId,
                    MerchantId          = merchantId,
                    MerchantApiKey      = merchant.ApiKey,
                    HasPublicKey        = !string.IsNullOrEmpty(publicKeyInfo.RsaPublicKey)
                };

                return(Ok(settings));
            }
            catch (Exception e)
            {
                _log.Error(e, new { employeeId, merchantId }.ToJson());

                return(BadRequest(ErrorResponse.Create(PayInvoicePortalApiErrorCodes.UnexpectedError)));
            }
        }
コード例 #19
0
        public ActionResult SaveSettings(string allPlayerNames)
        {
            SettingsResponse settingsResponse = new SettingsResponse();

            //List<string> playerNames = allPlayerNames.Split(',').ToList();
            //settingsResponse.PlayerNames = playerNames;

            var playerNames = allPlayerNames.Split(',');

            int currentIndex      = 0;
            int oddAmountModifier = 0;

            if (playerNames.Count() % 2 == 1)
            {
                oddAmountModifier = 1;
            }

            List <string> allMatchUps = new List <string>();

            while (currentIndex < playerNames.Length / 2)
            {
                int    opponentIndex  = playerNames.Length - (currentIndex + 1);
                string currentMatchUp = playerNames[currentIndex + oddAmountModifier] + " VS " + playerNames[opponentIndex];

                allMatchUps.Add(currentMatchUp);

                currentIndex++;
            }

            BracketMatchUpsViewModel viewModel = new BracketMatchUpsViewModel()
            {
                AllMatchUps         = allMatchUps,
                IsOddAmountOfPlayer = true,
                TotalMatchUpCount   = allMatchUps.Count
            };

            //var bracketResponse = PartialView("~/Views/Tournament/BracketMatchUps.cshtml", viewModel);
            var bracketResponse = Helpers.HtmlHelper.RenderPartialToString(this.ControllerContext, "~/Views/Tournament/BracketMatchUps.cshtml", viewModel);

            settingsResponse.BracketResultView  = bracketResponse;
            settingsResponse.TotalMatchUpsCount = allMatchUps.Count;
            return(Json(settingsResponse));
        }
コード例 #20
0
        private ResponseCode _handlePost(HttpListenerRequest req, HttpListenerResponse resp, string accesslog)
        {
            if (!req.HasEntityBody)
            {
                return(ResponseCode.NotFound);
            }

            SettingsResponse settingsresp = new SettingsResponse();

            try
            {
                using (Stream body = req.InputStream)
                {
                    Encoding encoding = req.ContentEncoding;
                    using (StreamReader reader = new StreamReader(body, encoding))
                    {
                        string           json        = reader.ReadToEnd();
                        SettingsPostBody newSettings = ServerConfig.fromJSON <SettingsPostBody>(json);
                        body.Close();
                        reader.Close();

                        if (newSettings.testingMode != server.config.testingMode)
                        {
                            server.config.testingMode = newSettings.testingMode;
                        }

                        accesslog += "\tsuccess";
                        ServerConfig.appendLog(accesslog);
                        settingsresp.success = true;
                    }
                }
            }
            catch (Exception e)
            {
                ServerConfig.appendLog("Error: " + e.Message + "\n" + e.StackTrace);
                settingsresp.success = false;
                accesslog           += "\tfailed";
                ServerConfig.appendLog(accesslog);
            }
            server.responseJSON(resp, settingsresp);
            return(ResponseCode.OK);
        }
コード例 #21
0
        public async Task <IHttpActionResult> UpdateSettingAsync(SettingsRequest request)
        {
            var response = new SettingsResponse();

            var accountId = Identity.ToAccountID();

            if (request.SettingViewModel.AccountId != accountId)
            {
                response.ErrorMessage = "Not permissions";
                response.StatusCode   = (int)HttpStatusCode.Forbidden;
            }
            else
            {
                await _settingService.UpdateSettingAsync(request.SettingViewModel);

                response.StatusCode = (int)HttpStatusCode.OK;
            }

            return(Ok(response));
        }
コード例 #22
0
        public async Task ShouldReturnSettingsResponse()
        {
            // Arrange
            var channelId = new Guid("5537AB43-B861-40F4-A446-B74174489B23");
            var setting   = new Settings();

            _settingRepositoryMock.Setup(x => x.GetSettingsByChannelIdAsync(It.Is <Guid>(ch => ch.Equals(channelId))))
            .ReturnsAsync(setting)
            .Verifiable();

            var settingsResponse = new SettingsResponse();

            _domainModelsMapperMock.Setup(x => x.MapToSettingsResponse(setting))
            .Returns(settingsResponse)
            .Verifiable();

            // Act
            var act = await _channelService.GetChannelSettingsAsync(channelId);

            // Assert
            act.Should().BeEquivalentTo(settingsResponse);
        }
コード例 #23
0
        private void ReceiveChangeSettingRequest(byte[] body, ulong senderId)
        {
            Log.Trace("Receiving Change Settings Request", "ReceiveConcealRequest");

            ChangeSettingRequest request = ChangeSettingRequest.FromBytes(body);

            Settings.Instance.ChangeSetting(request.Index, request.Value);

            /*
             * We actually resend settings, incase player is relying on them for data
             * ChangeSettingResponse response = new ChangeSettingResponse() {
             *  Success = true
             * };
             */

            SettingsResponse response = new SettingsResponse()
            {
                Settings = Settings.Instance
            };

            response.SendToPlayer(senderId);
        }
コード例 #24
0
        /// <summary>
        /// Call Settings command to get the expected template ID for template name
        /// </summary>
        /// <param name="templateName">A string that specifies the name of the rights policy template.</param>
        /// <returns>A string that identifies a particular rights policy template to be applied to the outgoing message.</returns>
        protected string GetTemplateID(string templateName)
        {
            // Get the template settings
            SettingsResponse settingsResponse = this.ASRMAdapter.Settings();

            // Choose the all rights policy template and get template ID.
            this.Site.Assert.IsNotNull(settingsResponse.ResponseData.RightsManagementInformation, "The RightsManagementInformation element should not be null in Settings response.");
            this.Site.Assert.IsNotNull(settingsResponse.ResponseData.RightsManagementInformation.Get, "The Get element should not be null in Settings response.");
            this.Site.Assert.IsNotNull(settingsResponse.ResponseData.RightsManagementInformation.Get.RightsManagementTemplates, "The RightsManagementTemplates element should not be null in Settings response.");
            string templateID = null;

            foreach (Response.RightsManagementTemplatesRightsManagementTemplate template in settingsResponse.ResponseData.RightsManagementInformation.Get.RightsManagementTemplates)
            {
                if (template.TemplateName == templateName)
                {
                    templateID = template.TemplateID;
                    break;
                }
            }

            this.Site.Assert.IsNotNull(templateID, "Template {0} is not found on the server. This may happen if MS-ASRM configuration is not performed properly.", templateName);
            return(templateID);
        }
コード例 #25
0
 /// <summary>
 /// Verify the rights-managed requirements about Settings response.
 /// </summary>
 /// <param name="settingsResponse">The response of Settings command.</param>
 private void VerifySettingsResponse(SettingsResponse settingsResponse)
 {
     // Verify the schema of MS-ASRM.
     if (settingsResponse.ResponseData.RightsManagementInformation != null)
     {
         if (settingsResponse.ResponseData.RightsManagementInformation.Get != null)
         {
             this.VerifyRightsManagementTemplates(settingsResponse.ResponseData.RightsManagementInformation.Get);
         }
     }
 }
コード例 #26
0
        /// <summary>
        /// Get AppliesToInternal OOF message from SettingsResponse
        /// </summary>
        /// <param name="settingsResponse">The settings response</param>
        /// <returns>The appliesToInternal OOF message</returns>
        protected static Response.OofMessage GetAppliesToInternalOofMessage(SettingsResponse settingsResponse)
        {
            for (int messageIndex = 0; messageIndex < settingsResponse.ResponseData.Oof.Get.OofMessage.Length; messageIndex++)
            {
                if (settingsResponse.ResponseData.Oof.Get.OofMessage[messageIndex].AppliesToInternal != null)
                {
                    return settingsResponse.ResponseData.Oof.Get.OofMessage[messageIndex];
                }
            }

            return null;
        }
コード例 #27
0
        public override string HandleMessage(Message msg)
        {
            var parse = msg.RawText.SplitCommandline();

            if (parse.Length == 0)
            {
                return(null);
            }

            if (parse[0] == ".quit")
            {
                Program.QuitRequested = true;
            }
            else if (parse[0] == ".addAdmin" && parse.Length > 1)
            {
                foreach (var user in msg.MentionedUsers)
                {
                    if (Program.Config.Admins.Contains(user.Id))
                    {
                        continue;
                    }
                    Program.Config.Admins.Add(user.Id);
                    Program.SaveConfig();
                }

                return("*Admins added.*");
            }
            else if (parse[0] == ".removeAdmin" && parse.Length > 1)
            {
                foreach (var user in msg.MentionedUsers)
                {
                    if (Program.Config.Admins.Contains(user.Id))
                    {
                        continue;
                    }
                    Program.Config.Admins.Add(user.Id);
                    Program.SaveConfig();
                }

                return("*Admins removed.*");
            }
            else if (parse[0] == ".addResponse" && parse.Length == 3)
            {
                if (parse[1].ToLower() == "miss")
                {
                    return("*No.*");
                }

                if (parse[1][0] != '.' && msg.User.Id != Program.Config.SuperAdmin)
                {
                    return("*Please start keyword with a period!*");
                }

                var newResponse = new SettingsResponse();
                newResponse.Keywords.Add(parse[1]);
                newResponse.Response = parse[2];
                Program.Config.Responses.Add(newResponse);

                return("*New response added.*");
            }
            else if (parse[0] == ".removeResponse" && parse.Length == 2)
            {
                var response = Program.Config.Responses.Find(r => r.Keywords.Contains(parse[1]));
                if (response == null)
                {
                    return("*No such response keyword found.*");
                }

                Program.Config.Responses.Remove(response);
                Program.SaveConfig();

                return("*Response removed.*");
            }
            else if (parse[0] == ".addResponseKeyword" && parse.Length == 3)
            {
                var response = Program.Config.Responses.Find(r => r.Keywords.Contains(parse[1]));
                if (response == null)
                {
                    return("*No such keyword found.*");
                }

                if (parse[2][0] != '.' && msg.User.Id != Program.Config.SuperAdmin)
                {
                    return("*Please start keyword with a period!*");
                }
                response.Keywords.Add(parse[2]);

                Program.SaveConfig();

                return("*New keyword added.*");
            }
            else if (parse[0] == ".removeResponseKeyword" && parse.Length == 2)
            {
                var response = Program.Config.Responses.Find(r => r.Keywords.Contains(parse[1]));
                if (response == null)
                {
                    return("*No such response keyword found.*");
                }

                response.Keywords.Remove(parse[1]);

                if (response.Keywords.Count == 0)
                {
                    Program.Config.Responses.Remove(response);
                    Program.SaveConfig();
                    return("*Response removed.*");
                }
                else
                {
                    Program.SaveConfig();
                    return("*Keyword removed.*");
                }
            }
            else if (parse[0] == ".useShortUrl")
            {
                bool val = false;
                if (bool.TryParse(parse[1], out val))
                {
                    Program.Config.UseShortUrls = val;
                    return("*Set short urls.*");
                }

                return("*I don't know what that means.*");
            }

            return(null);
        }
コード例 #28
0
        public void TestGetSettings()
        {
            SettingsResponse settings = _settingsService.GetSettings(Configuration.MerchantId);

            Assert.IsNotNull(settings);
        }
コード例 #29
0
        /// <summary>
        /// This method is used to verify the Settings response related requirements.
        /// </summary>
        /// <param name="settingsResponse">Settings command response.</param>
        private void VerifySettingsCommand(SettingsResponse settingsResponse)
        {
            Site.Assert.IsTrue(this.activeSyncClient.ValidationResult, "The schema validation result should be true.");
            Site.Assert.IsNotNull(settingsResponse.ResponseData, "The Settings element should not be null.");
            Site.Assert.IsNotNull(settingsResponse.ResponseData.Status, "The Settings status code should not be null");

            // Add the debug information.
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R485");

            // If the schema validation result is true and Status(Settings) is not null, this requirement can be verified.
            Site.CaptureRequirement(
                485,
                @"[In Settings] All property responses, regardless of the property, MUST contain a Status element to indicate success or failure.");

            // Add the debug information.
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R486");

            // If the schema validation result is true and Status(Settings) is not null, this requirement can be verified.
            Site.CaptureRequirement(
                486,
                @"[In Settings] This Status node MUST be the first node in the property response.");

            // Add the debug information.
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R3953");

            // If the schema validation result is true and Settings(Settings) is not null, this requirement can be verified.
            Site.CaptureRequirement(
                3953,
                @"[In Settings(Settings)] The Settings element is a required element in Settings command requests and responses that identifies the body of the HTTP POST as containing a Settings command (section 2.2.2.17).");

            // Add the debug information.
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R2631");

            // If the schema validation result is true and Settings(Settings) is not null, this requirement can be verified.
            Site.CaptureRequirement(
                2631,
                @"[In Settings(Settings)] None [Element Settings in Settings command response has no parent element.]");

            // Add the debug information.
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R2632");

            // If the schema validation result is true and Settings(Settings) is not null, this requirement can be verified.
            Site.CaptureRequirement(
                2632,
                @"[In Settings(Settings)] Element Settings in Settings command response, the child elements are RightsManagementInformation (section 2.2.3.147), Oof
,DeviceInformation, DevicePassword, UserInformation, Status (section 2.2.3.167.14).");

            // Add the debug information.
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R2633");

            // If the schema validation result is true and Settings(Settings) is not null, this requirement can be verified.
            Site.CaptureRequirement(
                2633,
                @"[In Settings(Settings)] Element Settings in Settings command response, the data type is container.");

            // Add the debug information.
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R2634");

            // If the schema validation result is true and Settings(Settings) is not null, this requirement can be verified.
            Site.CaptureRequirement(
                2634,
                @"[In Settings(Settings)] Element Settings in Settings command response, the number allowed is 1...1 (required).");

            this.VerifyContainerDataType();

            #region Capture code for RightsManagementInformation
            if (settingsResponse.ResponseData.RightsManagementInformation != null)
            {
                // Add the debug information.
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R2520");

                // If the schema validation result is true and RightsManagementInformation is not null, this requirement can be verified.
                Site.CaptureRequirement(
                    2520,
                    @"[In RightsManagementInformation] Element RightsManagementInformation in Settings command response, the parent element is Settings.");

                // Add the debug information.
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R2521");

                // If the schema validation result is true and RightsManagementInformation is not null, this requirement can be verified.
                Site.CaptureRequirement(
                    2521,
                    @"[In RightsManagementInformation] Element RightsManagementInformation in Settings command response, the child elements are Get, Status (section 2.2.3.167.14).");

                // Add the debug information.
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R2522");

                // If the schema validation result is true and RightsManagementInformation is not null, this requirement can be verified.
                Site.CaptureRequirement(
                    2522,
                    @"[In RightsManagementInformation] Element RightsManagementInformation in Settings command response, the data type is container.");

                // Add the debug information.
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R2523");

                // If the schema validation result is true and RightsManagementInformation is not null, this requirement can be verified.
                Site.CaptureRequirement(
                    2523,
                    @"[In RightsManagementInformation] Element RightsManagementInformation in Settings command response, the number allowed is 0…1 (optional).");

                this.VerifyContainerDataType();

                #region Capture code for Status
                Site.Assert.IsNotNull(settingsResponse.ResponseData.RightsManagementInformation.Status, "As a child element of RightsManagementInformation, the Status element should not be null.");

                int status;

                Site.Assert.IsTrue(int.TryParse(settingsResponse.ResponseData.RightsManagementInformation.Status, out status), "As a child element of RightsManagementInformation, the Status element should be an integer.");

                this.VerifyStatusElementForSettings();

                Common.VerifyActualValues("Status(Settings)", AdapterHelper.ValidStatus(new string[] { "1", "2", "5", "6" }), settingsResponse.ResponseData.RightsManagementInformation.Status, this.Site);

                // Add the debug information.
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R4391");

                // Verify MS-ASCMD requirement: MS-ASCMD_R4391
                // If above Common.VerifyActualValues method is not failed, this requirement can be verified.
                Site.CaptureRequirement(
                    4391,
                    @"[In Status(Settings)] The following table lists the valid values [1,2,5,6] for Status in a Settings command RightsManagementInformation Get operation, Oof Get operation, Oof Set operation, DeviceInformation Set operation, or UserInformation Get operation.");
                #endregion

                #region Capture code for Get
                Site.Assert.IsNotNull(settingsResponse.ResponseData.RightsManagementInformation.Get, "As a child element of RightsManagementInformation, the Get element should not be null.");

                // Add the debug information.
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R3113");

                // If the schema validation result is true and Get is not null, this requirement can be verified.
                Site.CaptureRequirement(
                    3113,
                    @"[In Get] The Get element is a required child element of the RightsManagementInformation element in Settings command RightsManagementInformation requests and responses.");

                // Add the debug information.
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R1739");

                // If the schema validation result is true and Get is not null, this requirement can be verified.
                Site.CaptureRequirement(
                    1739,
                    @"[In Get] Element Get in Settings command RightsManagementInformation response, the parent element is  RightsManagementInformation.");

                // Add the debug information.
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R1740");

                // If the schema validation result is true and Get is not null, this requirement can be verified.
                Site.CaptureRequirement(
                    1740,
                    @"[In Get] Element Get in Settings command RightsManagementInformation response, the child element is  rm:RightsManagementTemplates ([MS-ASRM] section 2.2.2.17).");

                // Add the debug information.
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R1741");

                // If the schema validation result is true and Get is not null, this requirement can be verified.
                Site.CaptureRequirement(
                    1741,
                    @"[In Get] Element Get in Settings command RightsManagementInformation response, the data type is container ([MS-ASDTYPE] section 2.2).");

                // Add the debug information.
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R1742");

                // If the schema validation result is true and Get is not null, this requirement can be verified.
                Site.CaptureRequirement(
                    1742,
                    @"[In Get] Element Get in Settings command RightsManagementInformation response, the number allowed is  1…1 (required).");

                this.VerifyContainerDataType();
                #endregion
            }
            #endregion

            #region Capture code for Oof
            if (settingsResponse.ResponseData.Oof != null)
            {
                // Add the debug information.
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R1991");

                // If the schema validation result is true and Oof is not null, this requirement can be verified.
                Site.CaptureRequirement(
                    1991,
                    @"[In Oof] Element Oof in Settings command response, the parent element is Settings.");

                // Add the debug information.
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R1992");

                // If the schema validation result is true and Oof is not null, this requirement can be verified.
                Site.CaptureRequirement(
                    1992,
                    @"[In Oof] Element Oof in Settings command response, the child elements are Get, Status (section 2.2.3.167.14).");

                // Add the debug information.
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R1993");

                // If the schema validation result is true and Oof is not null, this requirement can be verified.
                Site.CaptureRequirement(
                    1993,
                    @"[In Oof] Element Oof in Settings command response,  the data type is container.");

                // Add the debug information.
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R1994");

                // If the schema validation result is true and Oof is not null, this requirement can be verified.
                Site.CaptureRequirement(
                    1994,
                    @"[In Oof] Element Oof in Settings command response, the number allowed is 0...1 (optional).");

                this.VerifyContainerDataType();

                #region Capture code for Status
                Site.Assert.IsNotNull(settingsResponse.ResponseData.Oof.Status, "As a child element of Oof, the Status element should not be null.");

                int status;

                Site.Assert.IsTrue(int.TryParse(settingsResponse.ResponseData.Oof.Status, out status), "As a child element of Oof, the Status element should be an integer.");

                this.VerifyStatusElementForSettings();
                #endregion

                #region Capture code for Get
                if (settingsResponse.ResponseData.Oof.Get != null)
                {
                    // Add the debug information.
                    Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R1747");

                    // If the schema validation result is true and Get is not null, this requirement can be verified.
                    Site.CaptureRequirement(
                        1747,
                        @"[In Get] Element Get in Settings command Oof response, the parent element is Oof.");

                    // Add the debug information.
                    Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R1748");

                    // If the schema validation result is true and Get is not null, this requirement can be verified.
                    Site.CaptureRequirement(
                        1748,
                        @"[In Get] Element Get in Settings command Oof response, the child elements are OofState (section 2.2.3.118), StartTime (section 2.2.3.166.2), EndTime (section 2.2.3.58.2), OofMessage (section 2.2.3.117).");

                    // Add the debug information.
                    Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R1749");

                    // If the schema validation result is true and Get is not null, this requirement can be verified.
                    Site.CaptureRequirement(
                        1749,
                        @"[In Get] Element Get in Settings command Oof response, the data type is container.");

                    // Add the debug information.
                    Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R1750");

                    // If the schema validation result is true and Get is not null, this requirement can be verified.
                    Site.CaptureRequirement(
                        1750,
                        @"[In Get] Element Get in Settings command Oof response, the number allowed is 0...1 (optional).");

                    this.VerifyContainerDataType();

                    #region Capture code for OofState
                    if (settingsResponse.ResponseData.Oof.Get.OofStateSpecified)
                    {
                        // Add the debug information.
                        Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R2007");

                        // If the schema validation result is true and OofState is not null, this requirement can be verified.
                        Site.CaptureRequirement(
                            2007,
                            @"[In OofState] Element OofState in Settings command Oof response, the parent element is Get (section 2.2.3.79).");

                        // Add the debug information.
                        Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R2008");

                        // If the schema validation result is true and OofState is not null, this requirement can be verified.
                        Site.CaptureRequirement(
                            2008,
                            @"[In OofState] None [Element OofState in Settings command Oof response has no child element.]");

                        // Add the debug information.
                        Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R2009");

                        // If the schema validation result is true and OofState is not null, this requirement can be verified.
                        Site.CaptureRequirement(
                            2009,
                            @"[In OofState] Element OofState in Settings command Oof response, the data type is integer.");

                        // Add the debug information.
                        Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R2010");

                        // If the schema validation result is true and OofState is not null, this requirement can be verified.
                        Site.CaptureRequirement(
                            2010,
                            @"[In OofState] Element OofState in Settings command Oof response, the number allowed is 0...1 (optional).");

                        // Add the debug information.
                        Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R3530, the value for OofStatus element is {0}", settingsResponse.ResponseData.Oof.Get.OofState);

                        // Verify MS-ASCMD requirement: MS-ASCMD_R3530
                        Site.CaptureRequirementIfIsTrue(
                            settingsResponse.ResponseData.Oof.Get.OofState == OofState.Item0 || settingsResponse.ResponseData.Oof.Get.OofState == OofState.Item1 || settingsResponse.ResponseData.Oof.Get.OofState == OofState.Item2,
                            3530,
                            @"[In OofState] The following table lists the valid values [0, 1, 2] for OofState.");
                    }
                    #endregion

                    #region Capture code for StartTime

                    // Add the debug information.
                    Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R2687");

                    // If the schema validation result is true, this requirement can be verified.
                    Site.CaptureRequirement(
                        2687,
                        @"[In StartTime(Settings)] Element StartTime in Settings command Oof response, the parent element is Get (section 2.2.3.79).");

                    // Add the debug information.
                    Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R2688");

                    // If the schema validation result is true, this requirement can be verified.
                    Site.CaptureRequirement(
                        2688,
                        @"[In StartTime(Settings)] None [Element StartTime in Settings command Oof response has no child element.]");

                    // Add the debug information.
                    Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R2689");

                    // If the schema validation result is true, this requirement can be verified.
                    Site.CaptureRequirement(
                        2689,
                        @"[In StartTime(Settings)] Element StartTime in Settings command Oof response, the data type is datetime.");

                    this.VerifyDateTimeStructure();

                    // Add the debug information.
                    Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R2690");

                    // If the schema validation result is true, this requirement can be verified.
                    Site.CaptureRequirement(
                        2690,
                        @"[In StartTime(Settings)] Element StartTime in Settings command Oof response, the number allowed is 0...1 (optional).");

                    #endregion

                    #region Capture code for EndTime
                    // Add the debug information.
                    Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R1623");

                    // If the schema validation result is true, this requirement can be verified.
                    Site.CaptureRequirement(
                        1623,
                        @"[In EndTime(Settings)] Element EndTime in Settings command Oof response, the parent element is Get (section 2.2.3.75).");

                    // Add the debug information.
                    Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R1624");

                    // If the schema validation result is true, this requirement can be verified.
                    Site.CaptureRequirement(
                        1624,
                        @"[In EndTime(Settings)] None [Element EndTime in Settings command Oof response has no child element .]");

                    // Add the debug information.
                    Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R1625");

                    // Verify MS-ASCMD requirement: MS-ASCMD_R1625
                    Site.CaptureRequirementIfAreEqual<Type>(
                        typeof(DateTime),
                        settingsResponse.ResponseData.Oof.Get.EndTime.GetType(),
                        1625,
                        @"[In EndTime(Settings)] Element EndTime in Settings command Oof response, the data type is datetime.");

                    this.VerifyDateTimeStructure();

                    // Add the debug information.
                    Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R1626");

                    // If the schema validation result is true and EndTime(Settings) is not null, this requirement can be verified.
                    Site.CaptureRequirement(
                        1626,
                        @"[In EndTime(Settings)] Element EndTime in Settings command Oof response, the number allowed is 0...1 (optional).");
                    #endregion

                    #region Capture code for OofMessage
                    if (settingsResponse.ResponseData.Oof.Get.OofMessage != null && settingsResponse.ResponseData.Oof.Get.OofMessage.Length > 0)
                    {
                        // Add the debug information.
                        Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R1999");

                        // If the schema validation result is true and OofMessage is not null, this requirement can be verified.
                        Site.CaptureRequirement(
                            1999,
                            @"[In OofMessage] Element OofMessage in Settings command Oof response, the parent element is Get (section 2.2.3.79).");

                        // Add the debug information.
                        Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R2000");

                        // If the schema validation result is true and OofMessage is not null, this requirement can be verified.
                        Site.CaptureRequirement(
                            2000,
                            @"[In OofMessage] Element OofMessage in Settings command Oof response, the child elements are AppliesToInternal, AppliesToExternalKnown, AppliesToExternalUnknown, Enabled, ReplyMessage, BodyType.");

                        // Add the debug information.
                        Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R2001");

                        // If the schema validation result is true and OofMessage is not null, this requirement can be verified.
                        Site.CaptureRequirement(
                            2001,
                            @"[In OofMessage] Element OofMessage in Settings command Oof response, the data type is container.");

                        // Add the debug information.
                        Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R2002");

                        // Verify MS-ASCMD requirement: MS-ASCMD_R2002
                        Site.CaptureRequirementIfIsTrue(
                            settingsResponse.ResponseData.Oof.Get.OofMessage.Length <= 3,
                            2002,
                            @"[In OofMessage] Element OofMessage in Settings command Oof response, the number allowed is 0...3 (optional).");

                        this.VerifyContainerDataType();

                        foreach (OofMessage oofMessage in settingsResponse.ResponseData.Oof.Get.OofMessage)
                        {
                            #region Capture code for Enabled
                            if (oofMessage.Enabled != null)
                            {
                                // Add the debug information.
                                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R1607");

                                // If the schema validation result is true and Enabled is not null, this requirement can be verified.
                                Site.CaptureRequirement(
                                    1607,
                                    @"[In Enabled] Element Enabled in Settings command Oof request and response (section 2.2.2.16), the parent element is OofMessage (section 2.2.3.113).");

                                // Add the debug information.
                                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R1608");

                                // If the schema validation result is true and Enabled is not null, this requirement can be verified.
                                Site.CaptureRequirement(
                                    1608,
                                    @"[In Enabled] None [Element Enabled in Settings command Oof request and response (section 2.2.2.16) has no child element.]");

                                // Add the debug information.
                                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R1609");

                                // If the schema validation result is true and Enabled is not null, this requirement can be verified.
                                Site.CaptureRequirement(
                                    1609,
                                    @"[In Enabled] Element Enabled in Settings command Oof request and response (section 2.2.2.16), the data type is string ([MS-ASDTYPE] section 2.6).");

                                // Add the debug information.
                                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R1610");

                                // If the schema validation result is true and Enabled is not null, this requirement can be verified.
                                Site.CaptureRequirement(
                                    1610,
                                    @"[In Enabled] Element Enabled in Settings command Oof request and response (section 2.2.2.16), the number allowed is 0...1 (optional).");

                                this.VerifyStringDataType();
                            }
                            #endregion

                            #region Capture code for BodyType
                            if (oofMessage.BodyType != null)
                            {
                                // Add the debug information.
                                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R1103");

                                // If the schema validation result is true and BodyType is not null, this requirement can be verified.
                                Site.CaptureRequirement(
                                    1103,
                                    @"[In BodyType] Element BodyType in Settings command Oof response , the parent element is OofMessage.");

                                // Add the debug information.
                                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R1104");

                                // If the schema validation result is true and BodyType is not null, this requirement can be verified.
                                Site.CaptureRequirement(
                                    1104,
                                    @"[In BodyType] None [Element BodyType in Settings command Oof response has no child element.]");

                                // Add the debug information.
                                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R1105");

                                // If the schema validation result is true and BodyType is not null, this requirement can be verified.
                                Site.CaptureRequirement(
                                    1105,
                                    @"[In BodyType] Element BodyType in Settings command Oof response, the data type is string.");

                                // Add the debug information.
                                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R821, the value for BodyType element is {0}", oofMessage.BodyType);

                                // Verify MS-ASCMD requirement: MS-ASCMD_R821
                                Site.CaptureRequirementIfIsTrue(
                                    oofMessage.BodyType.Equals("Text", StringComparison.CurrentCultureIgnoreCase) || oofMessage.BodyType.Equals("HTML", StringComparison.CurrentCultureIgnoreCase),
                                    821,
                                    @"[In BodyType] The following are the permitted values for the BodyType element: Text, HTML.");
                            }
                            #endregion

                            #region Capture code for ReplyMessage
                            if (oofMessage.ReplyMessage != null)
                            {
                                // Add the debug information.
                                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R2451");

                                // If the schema validation result is true and ReplyMessage is not null, this requirement can be verified.
                                Site.CaptureRequirement(
                                    2451,
                                    @"[In ReplyMessage] Element ReplyMessage in Settings command Oof request and response (section 2.2.2.17), the parent element is OofMessage (section 2.2.3.117).");

                                // Add the debug information.
                                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R2452");

                                // If the schema validation result is true and ReplyMessage is not null, this requirement can be verified.
                                Site.CaptureRequirement(
                                    2452,
                                    @"[In ReplyMessage] None [ Element ReplyMessage in Settings command Oof request and response (section 2.2.2.17) has no child element.]");

                                // Add the debug information.
                                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R2453");

                                // If the schema validation result is true and ReplyMessage is not null, this requirement can be verified.
                                Site.CaptureRequirement(
                                    2453,
                                    @"[In ReplyMessage] Element ReplyMessage in Settings command Oof request and response (section 2.2.2.17), the data type is string ([MS-ASDTYPE] section 2.7).");

                                // Add the debug information.
                                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R2454");

                                // If the schema validation result is true and ReplyMessage is not null, this requirement can be verified.
                                Site.CaptureRequirement(
                                    2454,
                                    @"[In ReplyMessage] Element ReplyMessage in Settings command Oof request and response (section 2.2.2.17), the number allowed is 0...1 (optional).");
                            }
                            #endregion Capture code for ReplyMessage
                        }

                        XmlDocument xmlDoc = new XmlDocument();
                        xmlDoc.LoadXml(settingsResponse.ResponseDataXML);

                        if (xmlDoc.DocumentElement.HasChildNodes)
                        {
                            XmlNodeList appliesToInternalNodes = xmlDoc.DocumentElement.GetElementsByTagName("AppliesToInternal");
                            XmlNodeList appliesToExternalKnownNodes = xmlDoc.DocumentElement.GetElementsByTagName("AppliesToExternalKnown");
                            XmlNodeList appliesToExternalUnknownNodes = xmlDoc.DocumentElement.GetElementsByTagName("AppliesToExternalUnknown");

                            #region Capture code for AppliesToInternal
                            if (appliesToInternalNodes.Count > 0)
                            {
                                // Add the debug information.
                                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R1075");

                                // If the schema validation result is true and AppliesToInternal exists, this requirement can be verified.
                                Site.CaptureRequirement(
                                    1075,
                                    @"[In AppliesToInternal] Element AppliesToInternal in Settings command Oof request and response (section 2.2.2.17),the parent elements is OofMessage (section 2.2.3.117).");

                                // Add the debug information.
                                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R1076");

                                // If the schema validation result is true and AppliesToInternal exists, this requirement can be verified.
                                Site.CaptureRequirement(
                                    1076,
                                    @"[In AppliesToInternal] None [Element AppliesToInternal in Settings command Oof request and response (section 2.2.2.17) has no child element.]");

                                // Add the debug information.
                                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R1077");

                                // If the schema validation result is true and AppliesToInternal exists, this requirement can be verified.
                                Site.CaptureRequirement(
                                    1077,
                                    @"[In AppliesToInternal] None [Element AppliesToInternal in Settings command Oof request and response (section 2.2.2.17), the data type is None.]");

                                // Add the debug information.
                                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R1078");

                                // If the schema validation result is true and AppliesToInternal exists, this requirement can be verified.
                                Site.CaptureRequirement(
                                    1078,
                                    @"[In AppliesToInternal] Element AppliesToInternal in Settings command Oof request and response (section 2.2.2.16), the number allowed is 0...1 (Choice of AppliesToInternal, AppliesToExternalKnown (section 2.2.3.12), and AppliesToExternalUnknown (section 2.2.3.13)).");

                                foreach (XmlNode appliesToInternal in appliesToInternalNodes)
                                {
                                    // Add the debug information.
                                    Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R800");

                                    // Verify MS-ASCMD requirement: MS-ASCMD_R800
                                    Site.CaptureRequirementIfIsTrue(
                                        string.IsNullOrEmpty(appliesToInternal.InnerXml),
                                        800,
                                        @"[In AppliesToInternal] The AppliesToInternal element is an empty tag element, meaning it has no value or data type.");

                                    // Add the debug information.
                                    Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R801");

                                    // Verify MS-ASCMD requirement: MS-ASCMD_R801
                                    Site.CaptureRequirementIfIsTrue(
                                        string.IsNullOrEmpty(appliesToInternal.InnerXml),
                                        801,
                                        @"[In AppliesToInternal] It [AppliesToInternal element] is distinguished only by the presence or absence of the <AppliesToInternal/> tag.");
                                }
                            }
                            #endregion

                            #region Capture code for AppliesToExternalKnown
                            if (appliesToExternalKnownNodes.Count > 0)
                            {
                                // Add the debug information.
                                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R1067");

                                // If the schema validation result is true and AppliesToExternalKnown exists, this requirement can be verified.
                                Site.CaptureRequirement(
                                    1067,
                                    @"[In AppliesToExternalKnown] Element AppliesToExternalKnown in Settings command Oof request and response (section 2.2.2.17), the parent element is OofMessage (section 2.2.3.117).");

                                // Add the debug information.
                                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R1068");

                                // If the schema validation result is true and AppliesToExternalKnown exists, this requirement can be verified.
                                Site.CaptureRequirement(
                                    1068,
                                    @"[In AppliesToExternalKnown] None [Element  AppliesToExternalKnown in Settings command Oof request and response (section 2.2.2.17) has no child element.]");

                                // Add the debug information.
                                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R1069");

                                // If the schema validation result is true and AppliesToExternalKnown exists, this requirement can be verified.
                                Site.CaptureRequirement(
                                    1069,
                                    @"[In AppliesToExternalKnown] None [Element  AppliesToExternalKnown in Settings command Oof request and response (section 2.2.2.17), the data tye is None.]");

                                // Add the debug information.
                                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R1070");

                                // If the schema validation result is true and AppliesToExternalKnown exists, this requirement can be verified.
                                Site.CaptureRequirement(
                                    1070,
                                    @"[In AppliesToExternalKnown] Element AppliesToExternalKnown in Settings command Oof request and response (section 2.2.2.17), the number allowed is 0...1 (Choice of AppliesToInternal (section 2.2.3.14), AppliesToExternalKnown, and AppliesToExternalUnknown (section 2.2.3.13)).");

                                foreach (XmlNode appliesToExternalKnown in appliesToExternalKnownNodes)
                                {
                                    // Add the debug information.
                                    Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R781");

                                    // Verify MS-ASCMD requirement: MS-ASCMD_R781
                                    Site.CaptureRequirementIfIsTrue(
                                        string.IsNullOrEmpty(appliesToExternalKnown.InnerXml),
                                        781,
                                        @"[In AppliesToExternalKnown] The AppliesToExternalKnown element is an empty tag element, meaning it [AppliesToExternalKnown element] has no value or data type.");

                                    // Add the debug information.
                                    Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R782");

                                    // Verify MS-ASCMD requirement: MS-ASCMD_R782
                                    Site.CaptureRequirementIfIsTrue(
                                        string.IsNullOrEmpty(appliesToExternalKnown.InnerXml),
                                        782,
                                        @"[In AppliesToExternalKnown] It [AppliesToExternalKnown element] is distinguished only by the presence or absence of the <AppliesToExternalKnown/> tag.");
                                }
                            }
                            #endregion

                            #region Capture code for AppliesToExternalUnknown
                            if (appliesToExternalUnknownNodes.Count > 0)
                            {
                                // Add the debug information.
                                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R1071");

                                // If the schema validation result is true and AppliesToExternalUnknown exists, this requirement can be verified.
                                Site.CaptureRequirement(
                                    1071,
                                    @"[In AppliesToExternalUnknown] Element AppliesToExternalUnknown in Settings command Oof request and response (section 2.2.2.17), the parent element is
OofMessage (section 2.2.3.117)");

                                // Add the debug information.
                                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R1072");

                                // If the schema validation result is true and AppliesToExternalUnknown exists, this requirement can be verified.
                                Site.CaptureRequirement(
                                    1072,
                                    @"[In AppliesToExternalUnknown] None [Element AppliesToExternalUnknown in Settings command Oof request and response (section 2.2.2.17) has no child element.]");

                                // Add the debug information.
                                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R1073");

                                // If the schema validation result is true and AppliesToExternalUnknown exists, this requirement can be verified.
                                Site.CaptureRequirement(
                                    1073,
                                    @"[In AppliesToExternalUnknown] None [Element AppliesToExternalUnknown in Settings command Oof request and response (section 2.2.2.17), the data type is None.]");

                                // Add the debug information.
                                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R1074");

                                // If the schema validation result is true and AppliesToExternalUnknown exists, this requirement can be verified.
                                Site.CaptureRequirement(
                                    1074,
                                    @"[In AppliesToExternalUnknown] Element AppliesToExternalUnknown in Settings command Oof request and response (section 2.2.2.17), the number allowed is 0...1 (Choice of AppliesToInternal (section 2.2.3.14), AppliesToExternalKnown (section 2.2.3.12), and AppliesToExternalUnknown).");

                                foreach (XmlNode appliesToExternalUnknown in appliesToExternalUnknownNodes)
                                {
                                    // Add the debug information.
                                    Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R791");

                                    // Verify MS-ASCMD requirement: MS-ASCMD_R791
                                    Site.CaptureRequirementIfIsTrue(
                                        string.IsNullOrEmpty(appliesToExternalUnknown.InnerXml),
                                        791,
                                        @"[In AppliesToExternalUnknown] The AppliesToExternalUnknown element is an empty tag element, meaning it has no value or data type.");

                                    // Add the debug information.
                                    Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R792");

                                    // Verify MS-ASCMD requirement: MS-ASCMD_R792
                                    Site.CaptureRequirementIfIsTrue(
                                        string.IsNullOrEmpty(appliesToExternalUnknown.InnerXml),
                                        792,
                                        @"[In AppliesToExternalUnknown] It [AppliesToExternalUnknown element] is distinguished only by the presence or absence of the <AppliesToExternalUnknown/> tag.");
                                }
                            }
                            #endregion
                        }
                    }
                    #endregion
                }
                #endregion
            }
            #endregion

            #region Capture code for DeviceInformation
            if (settingsResponse.ResponseData.DeviceInformation != null)
            {
                // Add the debug information.
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R1506");

                // If the schema validation result is true and DeviceInformation is not null, this requirement can be verified.
                Site.CaptureRequirement(
                    1506,
                    @"[In DeviceInformation] Element DeviceInformation in Settings command response, the parent element is Settings.");

                // Add the debug information.
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R1507");

                // If the schema validation result is true and DeviceInformation is not null, this requirement can be verified.
                Site.CaptureRequirement(
                    1507,
                    @"[In DeviceInformation] Element DeviceInformation in Settings command response, the child element is  Status (section 2.2.3.167.14).");

                // Add the debug information.
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R1508");

                // If the schema validation result is true and DeviceInformation is not null, this requirement can be verified.
                Site.CaptureRequirement(
                    1508,
                    @"[In DeviceInformation] Element DeviceInformation in Settings command response, the data type is  container.");

                // Add the debug information.
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R1509");

                // If the schema validation result is true and DeviceInformation is not null, this requirement can be verified.
                Site.CaptureRequirement(
                    1509,
                    @"[In DeviceInformation] Element DeviceInformation in Settings command response, the number allowed is 0...1 (optional).");

                this.VerifyContainerDataType();

                Site.Assert.IsNotNull(settingsResponse.ResponseData.DeviceInformation.Status, "As child element of DeviceInformation, the Status element should not be null.");

                int status;

                Site.Assert.IsTrue(int.TryParse(settingsResponse.ResponseData.DeviceInformation.Status, out status), "As child element of DeviceInformation, the Status element should be an integer.");

                this.VerifyStatusElementForSettings();
            }
            #endregion

            #region Capture code for DevicePassword
            if (settingsResponse.ResponseData.DevicePassword != null)
            {
                // Add the debug information.
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R1514");

                // If the schema validation result is true and DevicePassword is not null, this requirement can be verified.
                Site.CaptureRequirement(
                    1514,
                    @"[In DevicePassword] Element DevicePassword in Settings command response, the parent element is Settings.");

                // Add the debug information.
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R1515");

                // If the schema validation result is true and DevicePassword is not null, this requirement can be verified.
                Site.CaptureRequirement(
                    1515,
                    @"[In DevicePassword] Element DevicePassword in Settings command response, the child element is Status (section 2.2.3.167.14).");

                // Add the debug information.
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R1516");

                // If the schema validation result is true and DevicePassword is not null, this requirement can be verified.
                Site.CaptureRequirement(
                    1516,
                    @"[In DevicePassword] Element DevicePassword in Settings command response, the data type is container.");

                // Add the debug information.
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R1517");

                // If the schema validation result is true and DevicePassword is not null, this requirement can be verified.
                Site.CaptureRequirement(
                    1517,
                    @"[In DevicePassword] Element DevicePassword in Settings command response, the number allowed is 0...1 (optional).");

                this.VerifyContainerDataType();

                Site.Assert.IsNotNull(settingsResponse.ResponseData.DevicePassword.Status, "As a child element of DevicePassword, the Status element should not be null.");

                int status;

                Site.Assert.IsTrue(int.TryParse(settingsResponse.ResponseData.DevicePassword.Status, out status), "As a child element of DevicePassword, the Status element should be an integer.");

                this.VerifyStatusElementForSettings();

                Common.VerifyActualValues("Status(Settings)", AdapterHelper.ValidStatus(new string[] { "1", "2", "5", "7" }), settingsResponse.ResponseData.DevicePassword.Status, this.Site);

                // Add the debug information.
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R4395");

                // Verify MS-ASCMD requirement: MS-ASCMD_R4395
                // If above Common.VerifyActualValues method is not failed, this requirement can be verified.
                Site.CaptureRequirement(
                    4395,
                    @"[In Status(Settings)] The following table lists the values [1,2,5,7] for Status in a Settings command DevicePassword Set response.");
            }
            #endregion

            #region Capture code for UserInformation
            if (settingsResponse.ResponseData.UserInformation != null)
            {
                // Add the debug information.
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R2903");

                // If the schema validation result is true and UserInformation is not null, this requirement can be verified.
                Site.CaptureRequirement(
                    2903,
                    @"[In UserInformation] Element UserInformation in Settings command response, the parent element is Settings.");

                // Add the debug information.
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R2904");

                // If the schema validation result is true and UserInformation is not null, this requirement can be verified.
                Site.CaptureRequirement(
                    2904,
                    @"[In UserInformation]  Element UserInformation in Settings command response, the child elements are Get, Status (section 2.2.3.167.14).");

                // Add the debug information.
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R2905");

                // If the schema validation result is true and UserInformation is not null, this requirement can be verified.
                Site.CaptureRequirement(
                    2905,
                    @"[In UserInformation]  Element UserInformation in Settings command response, the data type is container.");

                // Add the debug information.
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R2906");

                // If the schema validation result is true and UserInformation is not null, this requirement can be verified.
                Site.CaptureRequirement(
                    2906,
                    @"[In UserInformation]  Element UserInformation in Settings command response, the number allowed is 0...1 (optional).");

                this.VerifyContainerDataType();

                #region Capture code for Status
                Site.Assert.IsNotNull(settingsResponse.ResponseData.UserInformation.Status, "As child element of UserInformation, the Status element should not be null.");

                int status;

                Site.Assert.IsTrue(int.TryParse(settingsResponse.ResponseData.UserInformation.Status, out status), "As child element of UserInformation, the Status element should be an integer.");

                this.VerifyStatusElementForSettings();
                #endregion

                #region Capture code for Get
                Site.Assert.IsNotNull(settingsResponse.ResponseData.UserInformation.Get, "As a child element of UserInformation, the Get element should not be null.");

                // Add the debug information.
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R1755");

                // If the schema validation result is true and Get is not null, this requirement can be verified.
                Site.CaptureRequirement(
                    1755,
                    @"[In Get] Element Get in Settings command UserInformation response, the parent element is UserInformation.");

                // Add the debug information.
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R1758");

                // If the schema validation result is true and Get is not null, this requirement can be verified.
                Site.CaptureRequirement(
                    1758,
                    @"[In Get] Element Get in Settings command UserInformation response, the data type is container.");

                // Add the debug information.
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R1759");

                // If the schema validation result is true and Get is not null, this requirement can be verified.
                Site.CaptureRequirement(
                    1759,
                    @"[In Get] Element Get in Settings command UserInformation response, the number allowed is 1…1 (required).");

                // Add the debug information.
                Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R5854");

                // If the schema validation result is true and Get is not null, this requirement can be verified.
                Site.CaptureRequirement(
                    5854,
                    @"[In Get] The Get element is a required child element of the UserInformation element in Settings command UserInformation requests and responses.");

                bool hasEmailAddresses = false;
                bool hasAccounts = false;
                #region Capture code for EmailAddresses
                if (Common.GetConfigurationPropertyValue("ActiveSyncProtocolVersion", this.Site).Equals("12.1") || Common.GetConfigurationPropertyValue("ActiveSyncProtocolVersion", this.Site).Equals("14.0"))
                {
                    hasEmailAddresses = true;
                    if (settingsResponse.ResponseData.UserInformation.Get.EmailAddresses != null)
                    {
                        // Add the debug information.
                        Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R1597");

                        // If the schema validation result is true and EmailAddresses is not null, this requirement can be verified.
                        Site.CaptureRequirement(
                            1597,
                            @"[In EmailAddresses] Element EmailAddresses in Settings command UserInformation response (section 2.2.2.16), the data type is container ([MS-ASDTYPE] section 2.2).");

                        this.VerifyEmailAddresses(settingsResponse.ResponseData.UserInformation.Get.EmailAddresses);
                    }
                }
                #endregion

                #region Capture code for Accounts
                if (settingsResponse.ResponseData.UserInformation.Get.Accounts != null && settingsResponse.ResponseData.UserInformation.Get.Accounts.Length > 0)
                {
                    hasAccounts = true;

                    // Add the debug information.
                    Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R1023");

                    // If the schema validation result is true and Accounts is not null, this requirement can be verified.
                    Site.CaptureRequirement(
                        1023,
                        @"[In Accounts] Element Accounts in Settings command UserInformation response (section 2.2.2.17), the parent element is Get (section 2.2.3.79).");

                    // Add the debug information.
                    Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R1025");

                    // If the schema validation result is true and Accounts is not null, this requirement can be verified.
                    Site.CaptureRequirement(
                        1025,
                        @"[In Accounts] Element Accounts in Settings command UserInformation response (section 2.2.2.17), the data type is container ([MS-ASDTYPE] section 2.2).");

                    // Add the debug information.
                    Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R1026");

                    // If the schema validation result is true and Accounts is not null, this requirement can be verified.
                    Site.CaptureRequirement(
                        1026,
                        @"[In Accounts] Element Accounts in Settings command UserInformation response (section 2.2.2.17), the number allowed is 0…1 (optional).");

                    this.VerifyContainerDataType();

                    // Add the debug information.
                    Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R713");

                    // If the schema validation result is true and Account is not null, this requirement can be verified.
                    Site.CaptureRequirement(
                        713,
                        @"[In Account] The Account element is a required child element of the Accounts element in Settings command responses that contains all account information associated with a single account.");

                    // Add the debug information.
                    Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R998");

                    // If the schema validation result is true and Account is not null, this requirement can be verified.
                    Site.CaptureRequirement(
                        998,
                        @"[In Account] Element Account in Settings command UserInformation response (section 2.2.2.17), the parent element is Accounts (section 2.2.3.5).");

                    // Add the debug information.
                    Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R1001");

                    // If the schema validation result is true and there is any Account element, this requirement can be verified.
                    Site.CaptureRequirement(
                        1001,
                        @"[In Account] Element Account in Settings command UserInformation response (section 2.2.2.17), the number allowed is 1…N (required).");

                    foreach (AccountsAccount account in settingsResponse.ResponseData.UserInformation.Get.Accounts)
                    {
                        Site.Assert.IsNotNull(account, "The Account element should not be null.");

                        // Add the debug information.
                        Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R1024");

                        // If the schema validation result is true and Accounts contains Account, this requirement can be verified.
                        Site.CaptureRequirement(
                            1024,
                            @"[In Accounts] Element Accounts in Settings command UserInformation response (section 2.2.2.17), the child element is Account (section 2.2.3.2).");

                        // Add the debug information.
                        Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R999");

                        // If the schema validation result is true and Account is not null, this requirement can be verified.
                        Site.CaptureRequirement(
                            999,
                            @"[In Account] The element Account in Settings command UserInformation response (section 2.2.2.17), the child elements are AccountId (section 2.2.3.3.2), AccountName (section 2.2.3.4), UserDisplayName (section 2.2.3.181), SendDisabled (section 2.2.3.151), EmailAddresses (section 2.2.3.54).");

                        // Add the debug information.
                        Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R1000");

                        // If the schema validation result is true and Account is not null, this requirement can be verified.
                        Site.CaptureRequirement(
                            1000,
                            @"[In Account] Element Account in Settings command UserInformation response (section 2.2.2.17), the data type is container ([MS-ASDTYPE] section 2.2).");

                        if (account.EmailAddresses != null)
                        {
                            this.VerifyEmailAddresses(account.EmailAddresses);
                        }

                        this.VerifyContainerDataType();
                    }
                }
                #endregion
                #endregion Capture code for Get
            }
            #endregion

            #region Capture code for Status
            Site.Assert.IsNotNull(settingsResponse.ResponseData.Status, "The Status element should not be null.");

            int statusForSettings;

            Site.Assert.IsTrue(int.TryParse(settingsResponse.ResponseData.Status, out statusForSettings), "The Status element should be an integer.");

            this.VerifyStatusElementForSettings();

            Common.VerifyActualValues("Status(Settings)", AdapterHelper.ValidStatus(new string[] { "1", "2", "3", "4", "5", "6", "7" }), settingsResponse.ResponseData.Status, this.Site);

            // Add the debug information.
            Site.Log.Add(LogEntryKind.Debug, "Verify MS-ASCMD_R4386");

            // If above Common.VerifyActualValues method is not failed, this requirement can be verified.
            Site.CaptureRequirement(
                 4386,
                 @"[In Status(Settings)] The following table lists the valid values [1,2,3,4,5,6,7] for the Status element as the child element of the Settings element in the Settings command response.");
            #endregion
        }