How to write a performance test for a .Net application?

How to write a performance test for a .Net application? Is nUnit or any other testing framework needed for this?

Edit : I need to measure the performance of the WCF service.

+3
source share
5 answers

I came across NTime, which looks cool for writing performance tests.

http://www.codeproject.com/kb/dotnet/NTime.aspx

+2
source

, System.Diagnostic.StopWatch NUnit , .

primes [SetUp] ( ), , generatePrimes, , , 5 . , , , , .

    [Test]
    public void checkGeneratePrimesUpToTenMillion()
    {
        System.Diagnostics.Stopwatch timer = new System.Diagnostics.Stopwatch();
        timer.Start();
        long[] primeArray = primes.generatePrimes(10000000);
        timer.Stop();
        Assert.AreEqual(664579, primeArray.Length, "Should be 664,579 primes below ten million");
        int elapsedSeconds = timer.Elapsed.Seconds;
        Console.Write("Time in seconds to generate primes up to ten million: " + elapsedSeconds);
        bool ExecutionTimeLessThanFiveSeconds = (elapsedSeconds < 5);
        Assert.IsTrue(ExecutionTimeLessThanFiveSeconds, "Should take less than five seconds");
    }
+9

NUnit : "", , , , . .

. webapp, The Grinder , :

http://www.opensourcetesting.org/performance.php

0

Unit Testing. , . , :

, The Grinder. script Jython. , . ; .

0

VS Team System . , .

0

Source: https://habr.com/ru/post/1737039/


All Articles