Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. NUnitTest

NUnitTest

Scheduled Pinned Locked Moved ASP.NET
questiondesigntesting
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Satish_S
    wrote on last edited by
    #1

    hi i need to test the UI page which has two radio buttons. According to the selection of radio button by users functions will be called and those function uses 5 class files and in turn 5 methods. now i need to APPLY UNIT Test on above said functionality, how can i achieve this? what are the steps i need to start with.

    L 1 Reply Last reply
    0
    • S Satish_S

      hi i need to test the UI page which has two radio buttons. According to the selection of radio button by users functions will be called and those function uses 5 class files and in turn 5 methods. now i need to APPLY UNIT Test on above said functionality, how can i achieve this? what are the steps i need to start with.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Your classes should be designed in such a way that they can be unit tested without the actual involvement of UI elements. For example, in your case, a method should take an argument that is a flag to indicate which radio button was clicked. You can then apply text fixtures to this method and call it with different arguments to simulate selection of different radio buttons. To put it in another way, your code should not contain hard-coded logic that works differently for different selections of UI elements. It you write code that way, it is very difficult to unit test them.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups