Пример #1
0
        public void TriState_IFormattableWithValidStyle_GivesSameResultAsToString()
        {
            Random   randSource   = new Random();
            TriState testTriState = (Random.Next() % 3 - 1);

            TriState.Style testStyle =
                (new List <TriState.Style>
            {
                TriState.Style.YesUnknownNo,
                TriState.Style.NegativeEqualPositive,
                TriState.Style.TrueUndefinedFalse
            }).OrderBy(x => randSource.Next()).First();
            Assert.AreEqual(
                testTriState.ToString(testStyle),
                testTriState.ToString(testStyle.ToString(), null),
                "The result of IFormattable.ToString with the string representation of a style as the format should be the same as ToString with that same style.");
        }