asp.net - MSTest tutorials or walkthroughs -


i'm trying grips mstest. i'm using vs2010 entity framework 4 - not that's particularly important. i've scouted web tutorials haven't found useful. i'm using domain model if makes difference in terms of examples?

the easiest way started pull down "new" menu item, click project , select "test project." right in current solution easy gain access main project. next, go original project, right-click on class , select "create unit tests." result in dialog in can select methods test , testing project wish use (which default newly created test project). when "go" you'll see new testing class replete testing methods. might bit confusing @ beginning if focus on exercising methods , evaluating results should pretty clear pretty quickly.

note evaluations go through "assert" class; you'll test things "areequal", "istrue", etc. based on expected value , actual value. example:

  assert.areequal(120, bpi.cholesterol);   assert.istrue(bpi.hightriglyceride); 

when ide creates testing file, create region 4 methods: 1 run before test class created (a static), 1 run before each test, 1 run after each test, , 1 cleans after done. attributes important here - not method name.

when you've finished tests, use (newly added) testing buttons run either individual test (the 1 cursor rests) or of tests in testing project. you'll see results pop , you'll start getting handle on go here.

in time, write more , more tests, you'll find uses tests lists, etc. started now.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -