当前位置: 首页>>代码示例>>C#>>正文


C# ISettings.ToString方法代码示例

本文整理汇总了C#中ISettings.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# ISettings.ToString方法的具体用法?C# ISettings.ToString怎么用?C# ISettings.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ISettings的用法示例。


在下文中一共展示了ISettings.ToString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CompareSettings

        /// <summary>
        /// Compares two objects that implement ISettings.
        /// </summary>
        /// <param name="one">The first ISettings object.</param>
        /// <param name="two">The second ISettings object.</param>
        /// <remarks>Documented by Dev03, 2008-09-26</remarks>
        private void CompareSettings(ISettings one, ISettings two)
        {
            if ((one == null) || (two == null))
            {
                Assert.AreEqual(one, two, "Both settings should be null!");
                return;
            }
            if ((one != null) && (two != null))
            {
                //Basic type properties
                Assert.AreEqual<string>(one.AnswerCaption, two.AnswerCaption, "AnswerCaption do not match");
                Assert.AreEqual<bool?>(one.AutoBoxSize, two.AutoBoxSize, "AutoBoxSize do not match");
                Assert.AreEqual<bool?>(one.AutoplayAudio, two.AutoplayAudio, "AutoplayAudio do not match");
                Assert.AreEqual<bool?>(one.CaseSensitive, two.CaseSensitive, "CaseSensitive do not match");
                Assert.AreEqual<bool?>(one.IgnoreAccentChars, two.IgnoreAccentChars, "IgnoreAccentChars do not match");
                Assert.AreEqual<bool?>(one.ConfirmDemote, two.ConfirmDemote, "ConfirmDemote do not match");
                Assert.AreEqual<bool?>(one.CorrectOnTheFly, two.CorrectOnTheFly, "CorrectOnTheFly do not match");
                Assert.AreEqual<bool?>(one.EnableCommentary, two.EnableCommentary, "EnableCommentary do not match");
                Assert.AreEqual<bool?>(one.EnableTimer, two.EnableTimer, "EnableTimer do not match");
                Assert.AreEqual<bool?>(one.PoolEmptyMessageShown, two.PoolEmptyMessageShown, "PoolEmptyMessageShown do not match");
                Assert.AreEqual<string>(one.QuestionCaption, two.QuestionCaption, "QuestionCaption do not match");
                Assert.AreEqual<bool?>(one.RandomPool, two.RandomPool, "RandomPool do not match");
                Assert.AreEqual<bool?>(one.SelfAssessment, two.SelfAssessment, "SelfAssessment do not match");
                Assert.AreEqual<bool?>(one.ShowImages, two.ShowImages, "ShowImages do not match");
                Assert.AreEqual<bool?>(one.ShowStatistics, two.ShowStatistics, "ShowStatistics do not match");
                Assert.AreEqual<bool?>(one.SkipCorrectAnswers, two.SkipCorrectAnswers, "SkipCorrectAnswers do not match");
                Assert.AreEqual<string>(one.StripChars, two.StripChars, "StripChars do not match");
                Assert.AreEqual<string>(one.ToString(), two.ToString(), ".ToString() do not match");
                Assert.AreEqual<bool?>(one.UseLMStylesheets, two.UseLMStylesheets, "UseLMStylesheets do not match");

                //Other Types
                Assert.IsTrue(one.AnswerCulture.Equals(two.AnswerCulture), "AnswerCulture do not match");
                Assert.IsTrue(one.QuestionCulture.Equals(two.QuestionCulture), "QuestionCulture do not match");

                Assert.IsTrue(one.GradeSynonyms.Equals(two.GradeSynonyms), "GradeSynonyms do not match");

                Assert.IsTrue(one.GradeTyping.Equals(two.GradeTyping), "GradeTyping do not match");

                Assert.IsTrue(checkMedia(one.Logo, two.Logo), "Logo do not match");

                Assert.IsTrue(one.MultipleChoiceOptions.Equals(two.MultipleChoiceOptions), "MultipleChoiceOptions do not match");

                Assert.IsTrue(one.QueryDirections.Equals(two.QueryDirections), "QueryDirections do not match");

                Assert.IsTrue(one.QueryTypes.Equals(two.QueryTypes), "QueryTypes do not match");

                Assert.IsTrue(checkStyleSheet(one.AnswerStylesheet, two.AnswerStylesheet), "AnswerStylesheet do not match");
                Assert.IsTrue(checkStyleSheet(one.QuestionStylesheet, two.QuestionStylesheet), "QuestionStylesheet do not match");

                checkSelectedLearnChapters(one.SelectedLearnChapters, two.SelectedLearnChapters);

                checkCommentarySounds(one.CommentarySounds, two.CommentarySounds);

                //Snooze Options
                Assert.AreEqual<bool?>(one.SnoozeOptions.IsCardsEnabled, two.SnoozeOptions.IsCardsEnabled, "SnoozeOptions.IsCardsEnabled do not match");
                Assert.AreEqual<bool?>(one.SnoozeOptions.IsRightsEnabled, two.SnoozeOptions.IsRightsEnabled, "SnoozeOptions.IsRightsEnabled do not match");
                Assert.AreEqual<bool?>(one.SnoozeOptions.IsTimeEnabled, two.SnoozeOptions.IsTimeEnabled, "SnoozeOptions.IsTimeEnabled do not match");
                Assert.AreEqual<int?>(one.SnoozeOptions.SnoozeCards, two.SnoozeOptions.SnoozeCards, "SnoozeOptions.SnoozeCards do not match");
                Assert.AreEqual<int?>(one.SnoozeOptions.SnoozeHigh, two.SnoozeOptions.SnoozeHigh, "SnoozeOptions.SnoozeHigh do not match");
                Assert.AreEqual<int?>(one.SnoozeOptions.SnoozeLow, two.SnoozeOptions.SnoozeLow, "SnoozeOptions.SnoozeLow do not match");
                Assert.AreEqual<int?>(one.SnoozeOptions.SnoozeRights, two.SnoozeOptions.SnoozeRights, "SnoozeOptions.SnoozeRights do not match");
                Assert.AreEqual<int?>(one.SnoozeOptions.SnoozeTime, two.SnoozeOptions.SnoozeTime, "SnoozeOptions.SnoozeTime do not match");
                Assert.AreEqual<string>(one.SnoozeOptions.SnoozeMode.ToString(), two.SnoozeOptions.SnoozeMode.ToString(), "SnoozeOptions.SnoozeMode.ToString() do not match");
                Assert.AreEqual<ESnoozeMode>(one.SnoozeOptions.SnoozeMode.Value, one.SnoozeOptions.SnoozeMode.Value, "SnoozeOptions.SnoozeMode.Value do not match");

                //Styles
                CompareStyles(one.Style, two.Style);

            }
        }
开发者ID:hmehr,项目名称:OSS,代码行数:76,代码来源:CopyToTest.cs


注:本文中的ISettings.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。