Esempio n. 1
0
        public void ShouldHandleSimpleIdentifierAndValueWhileIgnoringInsignificantWhiteSpaceWithQuotes()
        {
            var input     = "    hel lo  =   \"wor ld\"   ";
            var tokenized = Tokenizers.TokenizeIdentifiers(input);

            Assert.That(tokenized.Identifier, Is.EqualTo("hel lo"));
            Assert.That(tokenized.IsQuoted, Is.True);
            Assert.That(tokenized.Value, Is.EqualTo("wor ld"));
        }
Esempio n. 2
0
        public void IdentiferAndValueForHPKP()
        {
            var input     = "pin-sha256=\"jV54RY1EPxNKwrQKIa5QMGDNPSbj3VwLPtXaHiEE8y8=\"";
            var tokenized = Tokenizers.TokenizeIdentifiers(input);

            Assert.That(tokenized.Identifier, Is.EqualTo("pin-sha256"));
            Assert.That(tokenized.IsQuoted, Is.True);
            Assert.That(tokenized.Value, Is.EqualTo("jV54RY1EPxNKwrQKIa5QMGDNPSbj3VwLPtXaHiEE8y8="));
        }
Esempio n. 3
0
        public void ShouldHandleSimpleIdentifierAndValue()
        {
            var input     = "hello=world";
            var tokenized = Tokenizers.TokenizeIdentifiers(input);

            Assert.That(tokenized.Identifier, Is.EqualTo("hello"));
            Assert.That(tokenized.IsQuoted, Is.False);
            Assert.That(tokenized.Value, Is.EqualTo("world"));
        }
Esempio n. 4
0
        public void ShouldHandleValuelessIdentifier()
        {
            var input     = "hello";
            var tokenized = Tokenizers.TokenizeIdentifiers(input);

            Assert.That(tokenized.Identifier, Is.EqualTo("hello"));
            Assert.That(tokenized.IsQuoted, Is.False);
            Assert.That(tokenized.Value, Is.Null);
        }
Esempio n. 5
0
        public void ShouldHandleSimpleIdentifierAndValueWhileIgnoringInsignificantWhiteSpace()
        {
            var input     = "    hel lo  =   wor ld   ";
            var tokenized = Tokenizers.TokenizeIdentifiers(input);

            Assert.Equal("hel lo", tokenized.Identifier);
            Assert.False(tokenized.IsQuoted);
            Assert.Equal("wor ld", tokenized.Value);
        }
Esempio n. 6
0
        public void ShouldHandleValuelessIdentifier()
        {
            var input     = "hello";
            var tokenized = Tokenizers.TokenizeIdentifiers(input);

            Assert.Equal("hello", tokenized.Identifier);
            Assert.False(tokenized.IsQuoted);
            Assert.Null(tokenized.Value);
        }
Esempio n. 7
0
        public void ShouldThrowErrorOnMissingKey()
        {
            var input = "=hello";

            Assert.That(() => Tokenizers.TokenizeIdentifiers(input), Throws.TypeOf <InvalidOperationException>());
        }