Open project-oagent-gh-app[bot] opened 4 months ago
LoadTest.cs
:using Microsoft.VisualStudio.TestTools.LoadTesting;
using System;
using System.Threading;
namespace LoadTest
{
public class LoadTestPlugin : ILoadTestPlugin
{
private LoadTest _loadTest;
public void Initialize(LoadTest loadTest)
{
_loadTest = loadTest;
_loadTest.TestStarting += LoadTestStartingHandler;
_loadTest.TestFinished += LoadTestFinishedHandler;
}
private void LoadTestStartingHandler(object sender, EventArgs e)
{
Console.WriteLine("Load test starting.");
}
private void LoadTestFinishedHandler(object sender, EventArgs e)
{
Console.WriteLine("Load test finished.");
}
}
}
#!/bin/bash
cat <<EOF > LoadTest.cs
using Microsoft.VisualStudio.TestTools.LoadTesting;
using System;
using System.Threading;
namespace LoadTest
{
public class LoadTestPlugin : ILoadTestPlugin
{
private LoadTest _loadTest;
public void Initialize(LoadTest loadTest)
{
_loadTest = loadTest;
_loadTest.TestStarting += LoadTestStartingHandler;
_loadTest.TestFinished += LoadTestFinishedHandler;
}
private void LoadTestStartingHandler(object sender, EventArgs e)
{
Console.WriteLine("Load test starting.");
}
private void LoadTestFinishedHandler(object sender, EventArgs e)
{
Console.WriteLine("Load test finished.");
}
}
}
EOF
Write the C# code to perform load testing on the application.