Commit edbf9302 edbf9302e54a9472aa8013f19bad0bca14c45d96 by Christian Gerdes

Updated for VS2015

1 parent b8c3ab11
......@@ -59,6 +59,24 @@ namespace PerformanceTestProject
//
#endregion
// Use TestInitialize to run code before running each test
private bool inLoadTest = false;
private bool dontKnow = true;
[TestInitialize()]
public void CheckTestContextType()
{
if (dontKnow)
{
// Check if the TestContext type is the one that a loadtest provides
if (TestContext.GetType().ToString().Equals("Microsoft.VisualStudio.TestTools.TestTypes.Unit.UnitTestAdapterContext"))
inLoadTest = true;
else
inLoadTest = false;
dontKnow = false;
TestContext.WriteLine("We have a loadtest TestContext: " + inLoadTest);
}
}
[TestMethod]
public void AF01_Validate()
{
......@@ -73,11 +91,11 @@ namespace PerformanceTestProject
// Logga vad vi gör...
TestContext.WriteLine("Anropar Validate med indata: " + "christian@gerdes.se");
// Skapa timer
TestContext.BeginTimer("01_ValidateCall");
if (inLoadTest) TestContext.BeginTimer("01_ValidateCall");
// Utför anrop mot tjänsten
bool response = myClient.ValidateAddress("christian@gerdes.se");
// Stoppa Timer
TestContext.EndTimer("01_ValidateCall");
if (inLoadTest) TestContext.EndTimer("01_ValidateCall");
// Verifiera svaret
TestContext.WriteLine("Svaret som mottogs är: " + response.ToString());
......@@ -109,11 +127,11 @@ namespace PerformanceTestProject
// Logga vad vi gör...
TestContext.WriteLine("Anropar CheckIfFull");
// Skapa timer
TestContext.BeginTimer("01_CheckIfFull");
if (inLoadTest) TestContext.BeginTimer("01_CheckIfFull");
// Utför anrop mot tjänsten
bool response = myClient.checkIfFull();
// Stoppa Timer
TestContext.EndTimer("01_CheckIfFull");
if (inLoadTest) TestContext.EndTimer("01_CheckIfFull");
// Verifiera svaret
TestContext.WriteLine("Svaret som mottogs är: " + response.ToString());
......@@ -145,11 +163,11 @@ namespace PerformanceTestProject
// Logga vad vi gör...
TestContext.WriteLine("Anropar CheckIfFull");
// Skapa timer
TestContext.BeginTimer("03_Register");
if (inLoadTest) TestContext.BeginTimer("03_Register");
// Utför anrop mot tjänsten
int response = myClient.RegisterAdress("christian.gerdes@lightsinline.se");
// Stoppa Timer
TestContext.EndTimer("03_Register");
if (inLoadTest) TestContext.EndTimer("03_Register");
// Verifiera svaret
TestContext.WriteLine("Svaret som mottogs är: " + response.ToString());
......

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.21005.1
# Visual Studio 14
VisualStudioVersion = 14.0.24720.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8784D56B-3A97-4F31-9E2F-36A6099C8D8E}"
ProjectSection(SolutionItems) = preProject
Local.testsettings = Local.testsettings
Taurus.testsettings = Taurus.testsettings
TraceAndTestImpact.testsettings = TraceAndTestImpact.testsettings
WCFPerformanceServiceDemo.vsmdi = WCFPerformanceServiceDemo.vsmdi
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PerformanceService", "PerformanceService\PerformanceService.csproj", "{298113F4-7126-4E1A-ADD1-F6C5327370E8}"
......