Static helper class used in the constraint-based syntax
Exemplo n.º 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."));
        }
Exemplo n.º 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."));
        }
Exemplo n.º 3
0
        public void Add()
        {
            var      section = new TableSection();
            TextCell first, second;

            section.Add(first = new TextCell {
                Text = "Text"
            });
            section.Add(second = new TextCell {
                Text = "Text"
            });

            Assert.That(section, NContains.Item(first));
            Assert.That(section, NContains.Item(second));
        }
Exemplo n.º 4
0
 /// <summary>
 /// Returns a new DictionaryContainsKeyConstraint checking for the
 /// presence of a particular key in the Dictionary key collection.
 /// </summary>
 /// <param name="expected">The key to be matched in the Dictionary key collection</param>
 public static DictionaryContainsKeyConstraint ContainKey(object expected)
 {
     return(Contains.Key(expected));
 }
Exemplo n.º 5
0
 /// <summary>
 /// Returns a new DictionaryContainsValueConstraint checking for the
 /// presence of a particular value in the Dictionary value collection.
 /// </summary>
 /// <param name="expected">The value to be matched in the Dictionary value collection</param>
 public static DictionaryContainsValueConstraint ContainValue(object expected)
 {
     return(Contains.Value(expected));
 }