Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Christian Gerdes
/
WCFPerformanceServiceDemo
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Issues
0
Wiki
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
edbf9302
...
edbf9302e54a9472aa8013f19bad0bca14c45d96
authored
2017-01-18 12:15:22 +0100
by
Christian Gerdes
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Updated for VS2015
1 parent
b8c3ab11
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
11 deletions
PerformanceTestProject/EmailValidatorPerfTest.cs
WCFPerformanceServiceDemo.sln
PerformanceTestProject/EmailValidatorPerfTest.cs
View file @
edbf930
...
...
@@ -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
());
...
...
WCFPerformanceServiceDemo.sln
View file @
edbf930
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio
2013
VisualStudioVersion = 1
2.0.21005.1
# Visual Studio
14
VisualStudioVersion = 1
4.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}"
...
...
Please
register
or
sign in
to post a comment