A unique load testing experiment

Most of the guidance you’ll find about Visual Studio Ultimate Load Tests suggests that they are only for load testing Web Performance tests. Actually, they can be used to load other types of tests, such as unit tests. I demonstrated this at STARWEST last week. Instead of load testing the execution of a database or other service, I thought I would try something fun. I created a simple unit test that played a random tone using the beep command and then placed that under load.

using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Cool.Tests
{
  [TestClass]
  public class Load
  {
    [TestMethod]
    public void BeepTest()
    {
      int frequency = new Random().Next(1000, 5000);
      Console.Beep(frequency, 50);
    }
  }
}

I then created a simple load test called Symphony.loadtest and added the BeepTest to it.
Load test running

The resulting load test was fun to listen to. Click the image below to see for yourself.
Symphony Load Test Running

Attachment: LoadTestProject.zip

Pin It

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>