Substring() public static method

Creates a new SubstringConstraint
public static Substring ( string substring ) : Constraint
substring string The value of the substring
return Constraint
Example #1
0
        public void Signature_throws_when_buffer_smaller_than_4()
        {
            var exception = Throws <ArgumentException>(() => new Sha256Signer(new byte[3]));

            That(exception.Message,
                 DoesContain.Substring("The buffer must have at least 4 bytes."));
        }
Example #2
0
        public void Signature_throws_at_the_beginning()
        {
            var exception = Throws <Exception>(() => {
                var _ = new Sha256Signer().Signature;
            });

            That(exception.Message,
                 DoesContain.Substring("The hash has not yet been calculated. Call 'Finish' to calculate the hash."));
        }