home recent topics recent posts search faq  

Pretty Objects Visual T# Forum



register | lost password   open id sign in with Twitter
Messages in this topic - RSS

Home » T# Videos » Relative assertions... code the rules!

Videos showing how to use Visual T#
|
11/16/2010 3:23:11 PM

Ludovic Dubois
Ludovic Dubois
Administrator
Posts: 159
In this video (13:30), you will learn to write tests with relative assertions:
  • Absolute Assertions
    runtest with hard-coded values: runtest item.Quantity = 2;
    Assertions with hard-coded values: assert item.Quantity == 2;

  • Relative Assertions to test changes
    runtest with relative values: runtest item.Quantity++;
    Assertions with relative values: assert changed item.Quantity++;

  • Relative Assertions to test non-changes
    Assertions with !changed: assert !changed item.UnitPrice;

  • Global Relative Assertions
    Assertions with * for properties (-* for fields): assert !changed item.*;
    Assertions with exceptions: assert !changed item.* except Quantity, Price;

  • Combined Assertions
    Assertions with relative assertion exceptions: assert !changed item.* except change Quantity++, change Price += product.Price;

  • Combined absolute Assertions
    Assertions with absolute assertion exceptions: assert !changed item.* except Quantity == 2, Price == 2 * product.Price;


Think the rule, code the rule... not the result of the rule once applied for hard-coded values. wink


Access source code from our svn server at: https://www.prettyobjects.com:7567/svn/public/TSharp/Samples/Products/?p=21


edited by Ludovic Dubois on 16/11/2010
<em>edited by Ludovic Dubois on 13/12/2010</em>

Attachments:
Business-7.avi
0 permalink
|

Home » T# Videos » Relative assertions... code the rules!





Powered by Jitbit Forum 7.2.14.1 © 2006-2011 Jitbit Software