Exemplo n.º 1
0
        public void ToStringReturnsValueString()
        {
            // Fixture setup
            var value = Fixture.Create <string>();

            // Exercise system
            var name = new LdapName(value);

            // Verify outcome
            name.ToString().Should().Be(value);
        }
Exemplo n.º 2
0
        public void NoEscapeIfSymbolAlreadyEscaped()
        {
            // Fixture setup
            const string value = @"John\, Doe";

            // Exercise system
            var name = new LdapName(value);

            // Verify outcome
            name.ToString().Should().Be(value);
        }
Exemplo n.º 3
0
        public void LeadingAndTrailingSpacesEscaped()
        {
            // Fixture setup
            const string value    = " Hello, World ";
            const string expected = "\\ Hello\\, World\\ ";

            // Exercise system
            var name = new LdapName(value);

            // Verify outcome
            name.ToString().Should().Be(expected);
        }
Exemplo n.º 4
0
        public void SpecialCharactersEscaped()
        {
            // Fixture setup

            const string value    = @",#+< \ >;""=";
            const string expected = @"\,\#\+\< \\ \>\;\""\=";

            // Exercise system
            var name = new LdapName(value);

            // Verify outcome
            name.ToString().Should().Be(expected);
        }