コード例 #1
0
ファイル: SameAsConstraint.cs プロジェクト: idavis/Ensurance
        /// <summary>
        /// Write the constraint description to a MessageWriter
        /// </summary>
        /// <exception cref="ArgumentNullException">if the message writer is null.</exception>
        /// <param name="writer">The writer on which the description is displayed</param>
        public override void WriteDescriptionTo( MessageWriter writer )
        {
            if ( writer == null )
            {
                throw new ArgumentNullException( "writer" );
            }

            writer.WritePredicate( Resources.SameAs );
            writer.WriteExpectedValue( _expected );
        }
コード例 #2
0
ファイル: StringConstraints.cs プロジェクト: idavis/Ensurance
        /// <summary>
        /// Write the constraint description to a MessageWriter
        /// </summary>
        /// <exception cref="ArgumentNullException">if the message writer is null.</exception>
        /// <param name="writer">The writer on which the description is displayed</param>
        public override void WriteDescriptionTo( MessageWriter writer )
        {
            if ( writer == null )
            {
                throw new ArgumentNullException( "writer" );
            }

            writer.WritePredicate( Resources.StringContaining );
            writer.WriteExpectedValue( _expected );
            if ( CaseInsensitive )
            {
                writer.WriteModifier( Resources.IgnoringCase );
            }
        }
コード例 #3
0
ファイル: TypeConstraints.cs プロジェクト: idavis/Ensurance
 /// <summary>
 /// Write a description of this constraint to a MessageWriter
 /// </summary>
 /// <exception cref="ArgumentNullException">if the message writer is null.</exception>
 /// <param name="writer"></param>
 public override void WriteDescriptionTo( MessageWriter writer )
 {
     if ( writer == null )
     {
         throw new ArgumentNullException( "writer" );
     }
     writer.WritePredicate( Resources.TypeAssignableFrom );
     writer.WriteExpectedValue( ExpectedType );
 }
コード例 #4
0
ファイル: StringConstraints.cs プロジェクト: idavis/Ensurance
        /// <summary>
        /// Write the constraint description to a MessageWriter
        /// </summary>
        /// <exception cref="ArgumentNullException">if the message writer is null.</exception>
        /// <param name="writer">The writer on which the description is displayed</param>
        public override void WriteDescriptionTo( MessageWriter writer )
        {
            if ( writer == null )
            {
                throw new ArgumentNullException( "writer" );
            }

            writer.WritePredicate( Resources.StringStartingWith );
            writer.WriteExpectedValue( MsgUtils.ClipString( _expected, writer.MaxLineLength - 40, 0 ) );
            if ( CaseInsensitive )
            {
                writer.WriteModifier( Resources.IgnoringCase );
            }
        }
コード例 #5
0
        /// <summary>
        /// Write the constraint description to a MessageWriter
        /// </summary>
        /// <exception cref="ArgumentNullException">if the message writer is null.</exception>
        /// <param name="writer">The writer on which the description is displayed</param>
        public override void WriteDescriptionTo( MessageWriter writer )
        {
            if ( writer == null )
            {
                throw new ArgumentNullException( "writer" );
            }

            writer.WritePredicate( string.Format( Resources.PropertyName_1, _name ) );
            BaseConstraint.WriteDescriptionTo( writer );
        }
コード例 #6
0
ファイル: RangeConstraint.cs プロジェクト: idavis/Ensurance
        /// <summary>
        /// Write the constraint description to a MessageWriter
        /// </summary>
        /// <exception cref="ArgumentNullException">if the message writer is null.</exception>
        /// <param name="writer">The writer on which the description is displayed</param>
        public override void WriteDescriptionTo( MessageWriter writer )
        {
            if ( writer == null )
            {
                throw new ArgumentNullException( "writer" );
            }

            writer.WritePredicate( Resources.Between );
            writer.WriteExpectedValue( _low );
            writer.WriteConnector( Resources.And );
            writer.WriteExpectedValue( _high );
        }
コード例 #7
0
ファイル: PrefixConstraints.cs プロジェクト: idavis/Ensurance
 /// <summary>
 /// Write a description of this constraint to a MessageWriter
 /// </summary>
 /// <param name="writer">The writer on which the description is displayed</param>
 /// <exception cref="ArgumentNullException">if the message writer is null.</exception>
 public override void WriteDescriptionTo( MessageWriter writer )
 {
     if ( writer == null )
     {
         throw new ArgumentNullException( "writer" );
     }
     writer.WritePredicate( Resources.NoItem );
     BaseConstraint.WriteDescriptionTo( writer );
 }