/// <summary>
        /// Generates an Enumerable of variations on all supported locales.
        /// </summary>
        #pragma warning disable SA1204 // Static elements should appear before instance elements
        private static IEnumerable <object[]> GetLocaleVariationTest()
        {
            var testLocales = new TestLocale[]
            {
                new TestLocale(Bulgarian),
                new TestLocale(Chinese),
                new TestLocale(Dutch),
                new TestLocale(English),
                new TestLocale(French),
                new TestLocale(German),
                new TestLocale(Hindi),
                new TestLocale(Italian),
                new TestLocale(Japanese),
                new TestLocale(Korean),
                new TestLocale(Portuguese),
                new TestLocale(Spanish),
                new TestLocale(Swedish),
                new TestLocale(Turkish),
            };

            foreach (var locale in testLocales)
            {
                yield return(new object[] { locale.ValidLocale, locale.InlineOr, locale.InlineOrMore, locale.Separator });

                yield return(new object[] { locale.CapEnding, locale.InlineOr, locale.InlineOrMore, locale.Separator });

                yield return(new object[] { locale.TitleEnding, locale.InlineOr, locale.InlineOrMore, locale.Separator });

                yield return(new object[] { locale.CapTwoLetter, locale.InlineOr, locale.InlineOrMore, locale.Separator });

                yield return(new object[] { locale.LowerTwoLetter, locale.InlineOr, locale.InlineOrMore, locale.Separator });
            }
        }
        /// <summary>
        /// Generates an Enumerable of variations on all supported locales.
        /// </summary>
        /// <returns>An iterable collection of objects.</returns>
        public static IEnumerable <object[]> GetLocaleVariationTest()
        {
            var testLocales = new TestLocale[]
            {
                new TestLocale(Bulgarian, "(1) да или (2) Не", "да", "Не"),
                new TestLocale(Chinese, "(1) 是的 要么 (2) 不", "是的", "不"),
                new TestLocale(Dutch, "(1) Ja of (2) Nee", "Ja", "Nee"),
                new TestLocale(English, "(1) Yes or (2) No", "Yes", "No"),
                new TestLocale(French, "(1) Oui ou (2) Non", "Oui", "Non"),
                new TestLocale(German, "(1) Ja oder (2) Nein", "Ja", "Nein"),
                new TestLocale(Hindi, "(1) हां या (2) नहीं", "हां", "नहीं"),
                new TestLocale(Italian, "(1) Si o (2) No", "Si", "No"),
                new TestLocale(Japanese, "(1) はい または (2) いいえ", "はい", "いいえ"),
                new TestLocale(Korean, "(1) 예 또는 (2) 아니", "예", "아니"),
                new TestLocale(Portuguese, "(1) Sim ou (2) Não", "Sim", "Não"),
                new TestLocale(Spanish, "(1) Sí o (2) No", "Sí", "No"),
                new TestLocale(Swedish, "(1) Ja eller (2) Nej", "Ja", "Nej"),
                new TestLocale(Turkish, "(1) Evet veya (2) Hayır", "Evet", "Hayır")
            };

            foreach (var locale in testLocales)
            {
                yield return(new object[] { locale.ValidLocale, locale.ValidLocale, locale.ExpectedPrompt, locale.InputThatResultsInOne, "1" });

                yield return(new object[] { locale.ValidLocale, locale.ValidLocale, locale.ExpectedPrompt, locale.InputThatResultsInZero, "0" });

                yield return(new object[] { locale.CapEnding, locale.CapEnding, locale.ExpectedPrompt, locale.InputThatResultsInOne, "1" });

                yield return(new object[] { locale.CapEnding, locale.CapEnding, locale.ExpectedPrompt, locale.InputThatResultsInZero, "0" });

                yield return(new object[] { locale.TitleEnding, locale.TitleEnding, locale.ExpectedPrompt, locale.InputThatResultsInOne, "1" });

                yield return(new object[] { locale.TitleEnding, locale.TitleEnding, locale.ExpectedPrompt, locale.InputThatResultsInZero, "0" });

                yield return(new object[] { locale.CapTwoLetter, locale.CapTwoLetter, locale.ExpectedPrompt, locale.InputThatResultsInOne, "1" });

                yield return(new object[] { locale.CapTwoLetter, locale.CapTwoLetter, locale.ExpectedPrompt, locale.InputThatResultsInZero, "0" });

                yield return(new object[] { locale.LowerTwoLetter, locale.LowerTwoLetter, locale.ExpectedPrompt, locale.InputThatResultsInOne, "1" });

                yield return(new object[] { locale.LowerTwoLetter, locale.LowerTwoLetter, locale.ExpectedPrompt, locale.InputThatResultsInZero, "0" });
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Generates an Enumerable of variations on all supported locales.
        /// </summary>
#pragma warning disable SA1204 // Static elements should appear before instance elements
        private static IEnumerable <object[]> GetLocaleVariationTest()
        {
            var testLocales = new TestLocale[]
            {
                new TestLocale(Chinese, "(1) 是的 要么 (2) 不", "是的", "不"),
                new TestLocale(Dutch, "(1) Ja of (2) Nee", "Ja", "Nee"),
                new TestLocale(English, "(1) Yes or (2) No", "Yes", "No"),
                new TestLocale(French, "(1) Oui ou (2) Non", "Oui", "Non"),
                new TestLocale(German, "(1) Ja oder (2) Nein", "Ja", "Nein"),
                new TestLocale(Japanese, "(1) はい または (2) いいえ", "はい", "いいえ"),
                new TestLocale(Portuguese, "(1) Sim ou (2) Não", "Sim", "Não"),
                new TestLocale(Spanish, "(1) Sí o (2) No", "Sí", "No"),
            };

            foreach (var locale in testLocales)
            {
                yield return(new object[] { locale.ValidLocale, locale.ValidLocale, locale.ExpectedPrompt, locale.InputThatResultsInOne, "1" });

                yield return(new object[] { locale.ValidLocale, locale.ValidLocale, locale.ExpectedPrompt, locale.InputThatResultsInZero, "0" });

                yield return(new object[] { locale.CapEnding, locale.CapEnding, locale.ExpectedPrompt, locale.InputThatResultsInOne, "1" });

                yield return(new object[] { locale.CapEnding, locale.CapEnding, locale.ExpectedPrompt, locale.InputThatResultsInZero, "0" });

                yield return(new object[] { locale.TitleEnding, locale.TitleEnding, locale.ExpectedPrompt, locale.InputThatResultsInOne, "1" });

                yield return(new object[] { locale.TitleEnding, locale.TitleEnding, locale.ExpectedPrompt, locale.InputThatResultsInZero, "0" });

                yield return(new object[] { locale.CapTwoLetter, locale.CapTwoLetter, locale.ExpectedPrompt, locale.InputThatResultsInOne, "1" });

                yield return(new object[] { locale.CapTwoLetter, locale.CapTwoLetter, locale.ExpectedPrompt, locale.InputThatResultsInZero, "0" });

                yield return(new object[] { locale.LowerTwoLetter, locale.LowerTwoLetter, locale.ExpectedPrompt, locale.InputThatResultsInOne, "1" });

                yield return(new object[] { locale.LowerTwoLetter, locale.LowerTwoLetter, locale.ExpectedPrompt, locale.InputThatResultsInZero, "0" });
            }
        }