public void TestParse_NameContainsWhitespace_Fail()
		{
			var buffer = new StringBuilder();
			SvcDirectiveParserState target = new AttributeNameParsingState( GetPrevious(), buffer );
			var reader = new StringReader( "Ser vice=" );
			target = target.Parse( reader );
		}
		public AttributeValueParsingState( AttributeNameParsingState previous, string attributeName, char quotation, StringBuilder buffer )
			: base( previous, buffer )
		{
			this._attributeName = attributeName;
			this._quotation = quotation;
			buffer.Clear();
		}
 public AttributeValueParsingState(AttributeNameParsingState previous, string attributeName, char quotation, StringBuilder buffer)
     : base(previous, buffer)
 {
     this._attributeName = attributeName;
     this._quotation     = quotation;
     buffer.Clear();
 }
		public void TestParse_OrdinalyNameTrailingEqualityWithoutQuatation_TransitToAttributeValueParsingState()
		{
			var buffer = new StringBuilder();
			SvcDirectiveParserState target = new AttributeNameParsingState( GetPrevious(), buffer );
			var reader = new StringReader( "ServiceClass=" );
			target = target.Parse( reader );
		}
        public void TestParse_OrdinalyNameTrailingEqualityWithoutQuatation_TransitToAttributeValueParsingState()
        {
            var buffer = new StringBuilder();
            SvcDirectiveParserState target = new AttributeNameParsingState(GetPrevious(), buffer);
            var reader = new StringReader("ServiceClass=");

            target = target.Parse(reader);
        }
        public void TestParse_NameContainsWhitespace_Fail()
        {
            var buffer = new StringBuilder();
            SvcDirectiveParserState target = new AttributeNameParsingState(GetPrevious(), buffer);
            var reader = new StringReader("Ser vice=");

            target = target.Parse(reader);
        }
        public void TestParse_PercentAndEnds_Fail()
        {
            var buffer = new StringBuilder();
            SvcDirectiveParserState target = new AttributeNameParsingState(GetPrevious(), buffer);
            var reader = new StringReader("%");

            target = target.Parse(reader);
        }
        public void TestParse_GreaterThanImmediately_Fail()
        {
            var buffer = new StringBuilder();
            SvcDirectiveParserState target = new AttributeNameParsingState(GetPrevious(), buffer);
            var reader = new StringReader(">");

            target = target.Parse(reader);
        }
        public void TestParse_EqualityImmediately_Fail()
        {
            var buffer = new StringBuilder();
            SvcDirectiveParserState target = new AttributeNameParsingState(GetPrevious(), buffer);
            var reader = new StringReader("=");

            target = target.Parse(reader);
            Assert.That(target, Is.TypeOf <AttributeValueParsingState>());
        }
		public void TestParse_OrdinalyNameTrailingEqualityAndSingleQuotation_TransitToAttributeValueParsingStateWithSingleQuotation()
		{
			var buffer = new StringBuilder();
			SvcDirectiveParserState target = new AttributeNameParsingState( GetPrevious(), buffer );
			var reader = new StringReader( "Service='" );
			target = target.Parse( reader );
			Assert.That( target, Is.TypeOf<AttributeValueParsingState>() );
			Assert.That( ( target as AttributeValueParsingState ).Quotation, Is.EqualTo( '\'' ) );
		}
        public void TestParse_PercentGreaterThanImmediately_TransitToFinishState()
        {
            var buffer = new StringBuilder();
            SvcDirectiveParserState target = new AttributeNameParsingState(GetPrevious(), buffer);
            var reader = new StringReader("%>");

            target = target.Parse(reader);
            Assert.That(target, Is.TypeOf <FinishedState>());
        }
        public void TestParse_OrdinalyNameTrailingEqualityAndSingleQuotation_TransitToAttributeValueParsingStateWithSingleQuotation()
        {
            var buffer = new StringBuilder();
            SvcDirectiveParserState target = new AttributeNameParsingState(GetPrevious(), buffer);
            var reader = new StringReader("Service='");

            target = target.Parse(reader);
            Assert.That(target, Is.TypeOf <AttributeValueParsingState>());
            Assert.That((target as AttributeValueParsingState).Quotation, Is.EqualTo('\''));
        }
		public void TestParse_OrdinalyNameAndWhitespaceTrailingEqualityAndQuatation_TransitToAttributeValueParsingState()
		{
			var buffer = new StringBuilder();
			SvcDirectiveParserState target = new AttributeNameParsingState( GetPrevious(), buffer );
			var reader = new StringReader( " Service = \"" );
			target = target.Parse( reader );
			Assert.That( target, Is.TypeOf<AttributeNameParsingState>() );
			
			target = target.Parse( reader );
			Assert.That( target, Is.TypeOf<AttributeValueParsingState>() );
		}
        public void TestParse_OrdinalyNameAndWhitespaceTrailingEqualityAndQuatation_TransitToAttributeValueParsingState()
        {
            var buffer = new StringBuilder();
            SvcDirectiveParserState target = new AttributeNameParsingState(GetPrevious(), buffer);
            var reader = new StringReader(" Service = \"");

            target = target.Parse(reader);
            Assert.That(target, Is.TypeOf <AttributeNameParsingState>());

            target = target.Parse(reader);
            Assert.That(target, Is.TypeOf <AttributeValueParsingState>());
        }
		public void TestParse_PercentAndEnds_Fail()
		{
			var buffer = new StringBuilder();
			SvcDirectiveParserState target = new AttributeNameParsingState( GetPrevious(), buffer );
			var reader = new StringReader( "%" );
			target = target.Parse( reader );
		}
		public void TestParse_GreaterThanImmediately_Fail()
		{
			var buffer = new StringBuilder();
			SvcDirectiveParserState target = new AttributeNameParsingState( GetPrevious(), buffer );
			var reader = new StringReader( ">" );
			target = target.Parse( reader );
		}
		public void TestParse_WhitespaceAndPercentGreaterThan_TransitToFinishState()
		{
			var buffer = new StringBuilder();
			SvcDirectiveParserState target = new AttributeNameParsingState( GetPrevious(), buffer );
			var reader = new StringReader( " %>" );
			target = target.Parse( reader );
			Assert.That( target, Is.TypeOf<AttributeNameParsingState>() );

			target = target.Parse( reader );
			Assert.That( target, Is.TypeOf<FinishedState>() );
		}
		public void TestParse_EqualityImmediately_Fail()
		{
			var buffer = new StringBuilder();
			SvcDirectiveParserState target = new AttributeNameParsingState( GetPrevious(), buffer );
			var reader = new StringReader( "=" );
			target = target.Parse( reader );
			Assert.That( target, Is.TypeOf<AttributeValueParsingState>() );
		}
示例#19
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FinishedState"/> class.
 /// </summary>
 /// <param name="previous">The previous state.</param>
 public FinishedState(AttributeNameParsingState previous) : base(previous)
 {
 }
示例#20
0
		/// <summary>
		/// Initializes a new instance of the <see cref="FinishedState"/> class.
		/// </summary>
		/// <param name="previous">The previous state.</param>
		public FinishedState( AttributeNameParsingState previous ) : base( previous ) { }