vs2003: quick snippet tool - visual-studio-2003

I am working on a HUGE vs2003 website. Is there a quick snippet tool that i could use to connect to my dev database and test out different pieces of my code instead of running website over and over again??

Well, just because you're building a web site doesn't mean that all your code has to be in a web site project. You can create a class library which your web site depends on, and then maybe a console app to make calls to that class library for test purposes.
Ideally, however, you'd have unit tests instead of ad hoc testing. You could create those unit tests with NUnit or various other test frameworks. (Using .NET 1.1 will limit which versions of those test frameworks you can use, admittedly.)

Related

ASP.NET to Mobile

Right now I am developing a website in visual studio using ASP.NET and C#. Is there any easy way to turn it into an application where iPhone users can get it on the app store. I heard something about Xamarin(monotouch), but I did not really understand exactly what it did.
No. Xamarin is a framework that lets you write Apps for iOS and Android using C# and accessing the native API frameworks. It does not allow you to simply port any .NET app to a mobile platform.
You can use responsive design to allow your ASP.NET site to work with both desktop and mobile browsers. See http://www.asp.net/mobile
As Jason wrote Monotouch enables you to build native applications. If you would choose a single page application approach you would be able to put the output in PhoneGap to publish it to the AppStore/Google Play.
That requires a bit of different thinking and doing, as you can't rely on the classic model with controllers/views and hard links.
However, it is still possible and I did it already for a project. I have an ASP.NET MVC application with Razor etc. as foundation, so I can easily manage the different "pages", dozens of different script files etc. However, all pages are Parial Views rendered within one single page. The nice thing about is, that this application works in each browser and is testable, too. To get it additionaly in an app container, we wrote a little tool that grabs all the output of that single page and converts it to a static HTML file, copying and referencing all the images, stylesheets and scripts, too.

How to do ASP.NET MVC Integration testing using selenium

I need to know is it possible to perform integration testing using selenium for ASP.NET MVC applications. If yes then What are the requirements and how to do it. Will it be an external application to test from UI or should I be using views. Really confused. Please guide
If you are planning to write the Selenium tests using C#, which I'd recommend over using any kind of test recorder, then this will be a separate project.
You will run this and it will test a deployed version of your application, ideally in a dedicated test environment. There is extensive documentation available.
Personally I and others prefer WatiN for testing web applications using C# written tests.
Selenium can be used for testing any web applications include ASP.NET MVC. In general, you add test project to solution and write tests in it. Selenium open browser and execute commands that is described in your test. You can write test in c# or can use recorder and save record as c# test.

What tools are available for calculating code coverage using browser automation tests

I have a website written in ASP.NET MVC 3. I have put together some browser automation tests that target this website. I want to use this same set of tests to calculate the code coverage of the website code.
I know that NCover does this kind of work but based on my knowledge there are two issues. One, NCover gives code coverage figures for both framework's code and my code. Two, it's costly.
NCover has filters that you can use to ignore the framework code.
You could also use OpenCover or PartCover to get these metrics and they are both open source and free - they also have filters.
Hooking them into IIS is tricky but if it is for automation tests then you can run your tests against IIS express - much easier.

how to add mvc test project to upgraded web application

I have an existing asp.net web application that I'm updating to include some MVC pages. I have successfully upgraded the web app to recognize my MVC controllers/views/... I can even get my test page to display correctly: hooray!
However, I am having trouble figuring out how to add a test project so that I can add my unit tests for the new pages. Does anyone have a suggestion on how to achieve this goal?
If you are using MSTest right click on the solution and Add -> New Project.... Select Test Project type. In the newly created project reference the project containing the controllers and start adding unit tests.
If you are using some 3rd party unit testing framework such as NUnit you could add a project of type Class Library and then add the unit tests to this class library.

Functional test software/framework that covers Asp.Net Web Apps?

I recently began to use the NexusLight, a functional test automation framework.
Are there more frameworks that does a similar job?
Related question: End-to-End application testing from a users standpoint
I haven't really looked into NexusLight but I think InCisif.net is supposed to provide a functional test framework as well. You could look into it.
I test asp.net web apps for years and the only tool I use is Watir.
VSTT 2010 should be a good bet if you are looking for functional test automation. Web Services Testing, UI testing, Biztalk testing and Data Driven Testing Support. Please look at VSTT - http://msdn.microsoft.com/en-us/library/ee338734(v=vs.90).aspx
You can also try VSTT - http://blogs.msdn.com/b/slumley/archive/2009/05/28/vsts-2010-feature-enhancements-for-web-test-playback-ui.aspx
Telerik Test Tools - http://www.telerik.com/automated-testing-tools.aspx
Visual Studio UI Test Extensibility–Scenarios & Guiding Principles - http://blogs.msdn.com/b/mathew_aniyan/archive/2011/03/28/visual-studio-ui-test-extensibility-scenarios-amp-guiding-principles.aspx
VSTS Web Test Step-by-Step Primer - http://blogs.msdn.com/b/jimmymay/archive/2009/02/23/vsts-web-test-step-by-step-primer-7-minute-video-by-microsoft-a-c-e-performance-engineer-chris-lundquist-with-copious-notes-screen-shots-from-your-humble-correspondent.aspx
Found this one too:
http://www.automatedqa.com/products/testcomplete/index.asp
Unfortunately it's not free.
Reading a list made by Scott Hanselman, I found these two tools:
WatiN, to automated the tests;
WatiN Test Recorder, to automate the test code generation.
From WatiN page:
[...]WatiN (pronounced as What-in) website. Inspired by Watir development of WatiN started in December 2005 to make a similar kind of Web Application Testing possible for the .Net languages.
And from WatiN Test Recorder:
The purpose of the application is to generate code compatible with the WatiN (Web Application Testing In .NET) project.
Have a look at Seleno. It uses Selenium under the bonnet but abstracts all browser automation into Page Objects, which lead to well structured and fluid C# based tests.
It is particularly well suited to ASP.NET MVC, as each Page Object can be strongly typed (using Generics) to an equivalent MVC ViewModel, leading to a consistent relationship between View, ViewModel and Page Object.
Check out some of the samples in the Seleno codebase to see this in action.

Resources