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. NUnit in ASP.Net

NUnit in ASP.Net

Scheduled Pinned Locked Moved ASP.NET
csharpasp-nethelp
6 Posts 3 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.
  • M Offline
    M Offline
    Malayil alex
    wrote on last edited by
    #1

    Hi, I need your help and suggestions regarding NUnit in asp.net....I am trying to write NUnit test cases for my asp.net application...can anybody suggest me some good practise for writing that..or some good sample codes for that..I started working on that..but it's not going smmothly..specially while saving the data...like that...please help me... regards alex.

    N 1 Reply Last reply
    0
    • M Malayil alex

      Hi, I need your help and suggestions regarding NUnit in asp.net....I am trying to write NUnit test cases for my asp.net application...can anybody suggest me some good practise for writing that..or some good sample codes for that..I started working on that..but it's not going smmothly..specially while saving the data...like that...please help me... regards alex.

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      To test ASP.NET dependent code, you can use NUnitasp[^]. AFAIK, it's not good like the real NUnit. You can use NUnit itself to test your application, but you won't be able to include ASP.NET dependent code like Server.MapPath or HttpContext.Current etc. But you can test your class libraries and business rules. Also VS team system has some unit testing features, I guess that can be used to test ASP.NET applications.

      All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions

      M 1 Reply Last reply
      0
      • N N a v a n e e t h

        To test ASP.NET dependent code, you can use NUnitasp[^]. AFAIK, it's not good like the real NUnit. You can use NUnit itself to test your application, but you won't be able to include ASP.NET dependent code like Server.MapPath or HttpContext.Current etc. But you can test your class libraries and business rules. Also VS team system has some unit testing features, I guess that can be used to test ASP.NET applications.

        All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions

        M Offline
        M Offline
        Malayil alex
        wrote on last edited by
        #3

        exactly..i am planning to test classlibraries..do u have any idea about this...ie, writing test cases for class libraries

        N 1 Reply Last reply
        0
        • M Malayil alex

          exactly..i am planning to test classlibraries..do u have any idea about this...ie, writing test cases for class libraries

          N Offline
          N Offline
          N a v a n e e t h
          wrote on last edited by
          #4

          It's pretty straight forward. Have you downloaded NUnit ? Go through the get started section. Basically to get started, you can create a new project in your solution and keep all your test classes inside that. So you can avoid that class when you release your project.

          All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions

          M 1 Reply Last reply
          0
          • N N a v a n e e t h

            It's pretty straight forward. Have you downloaded NUnit ? Go through the get started section. Basically to get started, you can create a new project in your solution and keep all your test classes inside that. So you can avoid that class when you release your project.

            All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions

            M Offline
            M Offline
            Malayil alex
            wrote on last edited by
            #5

            Ys i already started..but i am stucked how can i write test cases for save functionality....

            C 1 Reply Last reply
            0
            • M Malayil alex

              Ys i already started..but i am stucked how can i write test cases for save functionality....

              C Offline
              C Offline
              ChrisKo 0
              wrote on last edited by
              #6

              Your save function should have a return type, either bool or maybe int. You can assert that correct data passed to the save function will return true (in case of bool, or a 0 for int) and for bad data a return of false (or a specified error code for ints). You could always have a custom return type if you wanted.

              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