2 Replies - 1153 Views - Last Post: 24 May 2010 - 01:10 AM Rate Topic: -----

#1 Barbi Salazar  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 23-May 10

Unit Testing

Posted 23 May 2010 - 10:44 PM

Hello,

How to write unit test method for c# windows based application in .Net VS 2008 for example button_click method?

Thanks
Barbi
Is This A Good Question/Topic? 0
  • +

Replies To: Unit Testing

#2 MentalFloss  Icon User is offline

  • "ADDICTED"[2:5]
  • member icon

Reputation: 526
  • View blog
  • Posts: 1,397
  • Joined: 02-September 09

Re: Unit Testing

Posted 23 May 2010 - 11:57 PM

Your first step is to get the behavior of pressing that button into a method that doesn't require pressing the button. Once that's done, then your test calls that method.

Based on whatever it actually does, you write your asserts for it.

Unit testing is pretty tricky stuff.

This post has been edited by MentalFloss: 23 May 2010 - 11:57 PM

Was This Post Helpful? 0
  • +
  • -

#3 FlashM  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 382
  • View blog
  • Posts: 1,195
  • Joined: 03-December 09

Re: Unit Testing

Posted 24 May 2010 - 01:10 AM

You should use the NUnit or some other program for unit testing. I believe NUnit has some preety good examples on their web page that you can follow.

This post has been edited by FlashM: 24 May 2010 - 01:11 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1