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.")); }
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.")); }
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)); }
/// <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)); }
/// <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)); }