Collection assertions :

  • AllOfSameType
    Ensure.That(list).Are.AllOfSameType(); 
     
  • ElementCount
    Ensure.That(list).Has.ElementCount(5); 
     
  • Empty
    Ensure.That(list).Is.Empty 
     
  • LessElementsThan
    Ensure.That(list).Has.LessElementsThan(5); 
     
  • MoreElementsThan
    Ensure.That(list).Has.MoreElementsThan(5); 

Reference assertions:

  • EqualTo
    Ensure.That(text).Is.EqualTo("qwerty");
     
  • InstanceOf
    Ensure.That(text).Is.InstanceOf(typeof(String));
    or
    Ensure.That(text).Is.InstanceOf<string>();
     
  • Null
    Ensure.That(text).Is.Null();
     
  • SameAs
    Ensure.That(text).Is.SameAs(text2); 
 

Other assertions :

  • EqualTo
    Ensure.That(3+2).Is.EqualTo(5);
  • GreaterThan
    Ensure.That(3).Is.Greater.Than(2);
  • LessThan
    Ensure.That(3).Is.LessThan(4);
  • Zero
    Ensure.That(1-1).Is.Zero(); 
  • True
    Ensure.That(value).Is.True();
  • False
    Ensure.That(value).Is.False() 
  • And
    Ensure.That(value).IsInstanceOfType<string>().And(a=>a.Length).Is.GreaterThan(3);

Last edited Jun 20, 2011 at 10:27 PM by Arvander, version 3

Comments

No comments yet.