This is pretty cool that you can use this technique to test around .net framework items like this
I have been looking around for a quick easy load testing package. Right now I’m trying out OpenSTA. I can’t say that it has been very direct, but I am still holding out hope that it will work.
This is the Getting Started Guide that I have been using.
NAnt is a tool that can help you build your .net applications.
You can get really detailed with it, but what if you just want to set it up to quickly build projects/solutions or run automated builds. This is especially useful if you are rebuilding 1 project that you are in the process of testing so you don’t have to wait for VS to figure out if any of the referenced projects need to be rebuilt.
Well, with a few quick steps you can have this.
After downloading NAnt you need to create a little batch file somewhere in your PATH (for example, c:windows). Name the file nant.bat and put this in it:
@echo off "C:appsnantnant-0.86-beta1binNAnt.exe" %*
You will obviously want to replace my path with your own path to your nant exe that you downloaded.
Then add an entry to your PATH system variable to the directory that contains devenv.com. For me this path is:
C:Program FilesMicrosoft Visual Studio 8Common7ide
Then you just need to add a .build file to your project. I name it the same as my project name but you can do whatever you want.
This build file should contain the following XML:
<?xml version="1.0"?> <project name="ProjName" default="build" basedir="."> <target name="build"> <exec failonerror="true" program="devenv.com" commandline="ProjName.vbproj /build Debug" /> </target> </project>
Rename ProjName as needed in this file as well.
Then all you need to do is navigate to the folder that contains the .build file from a command line and run:
It will scan for the build file, and use devenv.com to build it.
You can also use this to build solutions, just change the .vbproj file to a .sln file.
I am always on the lookout for better and easier ways to automate testing of my applications. Mostly, this stems from my teams not being too keen on implementing testing, so the easier I can make it, the easier it will be to convince others to write tests.
Hopefully I can find some free time (HAHAHHAAH) when I can test this out more in a project.
I came across this CodePlex project called Plasma which is supposed to aid in testing web apps with standard unit test frameworks.
I couldn’t find much info on their codeplex site, but I will be keeping track of it to see if I can find some info.
I linked to this article in my last post, but here are 2 from Roy that are really about HOW to write code that is testable.
As someone who is trying to jump into the unit testing world, one of the major problems I had was deciding on using NUnit (which everyone uses) or use MSTest(built in).
I didn’t want to jump into this and realize 500 hours later that I picked the wrong framework. Well, now it seems I don’t have to worry about that as much.
First I was reading this article by Roy Osherove, and somehow I ended up on this page talking about converting between NUnit and VSTS projects, and from there I found a link to this page, which contained this great piece of code:
#If NUNIT Then Imports NUnit.Framework Imports TestClass = NUnit.Framework.TestFixtureAttribute Imports TestMethod = NUnit.Framework.TestAttribute Imports TestInitialize = NUnit.Framework.SetUpAttribute Imports TestCleanup = NUnit.Framework.TearDownAttribute #Else Imports Microsoft.VisualStudio.TestTools.UnitTesting #End If
This allows you do have the came code for NUnit and MSTest. Just change the NUNIT variable and recompile.
The other thing you need to do is use <TestAttribute()> instead of <Test()> on your NUnit tests, but I don’t see the difference there.
Over at TheServerSide they had a nice writeup of an example of how to use NUnitASP to test the UI of some pages.
I am not sure how valuable this would be to invest my time in, espically as it seems that there is now way to test repeaters or gridviews (there is a datagridtester however).
I will have to look some more and see if ther eis a way to do this.
This is awesome!
Some of these are pretty funny:
Magic numbers: Including unexplained numbers in algorithms
Superboolean logic: unnecessary comparison or abstraction of boolean arithmetic
Boat anchor: Retaining a part of a system that no longer has any use
Roy Osherove blogs that he was mistaken when he suggesting using mocks for data access code. With the improved Rollback attributes that he helped create, along with people like Justin Burtch who created a similar attribute for VSTS, they are now thinking that this is the way to go: rolling back database changes.