NUnit in ASP.Net
-
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.
-
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.
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
orHttpContext.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
-
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
orHttpContext.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
exactly..i am planning to test classlibraries..do u have any idea about this...ie, writing test cases for class libraries
-
exactly..i am planning to test classlibraries..do u have any idea about this...ie, writing test cases for class libraries
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
-
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
Ys i already started..but i am stucked how can i write test cases for save functionality....
-
Ys i already started..but i am stucked how can i write test cases for save functionality....
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.