Beispiel #1
0
        public void ToBsonDocument_should_return_expected_result_when_strength_is_set(
            [Values("en_US", "fr_CA")]
            string locale,
            [Values(null, CollationStrength.Primary, CollationStrength.Identical)]
            CollationStrength?strength)
        {
            var subject = new Collation(locale, strength: strength);

            var result = subject.ToBsonDocument();
            var json   = subject.ToString();

            var expectedResult = new BsonDocument
            {
                { "locale", locale },
                { "strength", () => Collation.ToInt32(strength.Value), strength.HasValue }
            };

            result.Should().Be(expectedResult);
            json.Should().Be(expectedResult.ToJson());
        }
Beispiel #2
0
        public void ToInt32_with_maxVariable_should_return_expected_result(CollationStrength strength, int expectedResult)
        {
            var result = Collation.ToInt32(strength);

            result.Should().Be(expectedResult);
        }