Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
StackExchange.Redis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tsai
StackExchange.Redis
Commits
64e597b9
Commit
64e597b9
authored
Oct 22, 2015
by
Jeremy Meng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update to NUnit 3.0. The ExpectedExceptionAttribute is gone.
parent
c32ac415
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
65 additions
and
74 deletions
+65
-74
Config.cs
MigratedBookSleeveTestSuite/Config.cs
+25
-14
SO10504853.cs
MigratedBookSleeveTestSuite/Issues/SO10504853.cs
+21
-16
MigratedBookSleeveTestSuite.csproj
...tedBookSleeveTestSuite/MigratedBookSleeveTestSuite.csproj
+3
-3
Program.cs
MigratedBookSleeveTestSuite/Program.cs
+0
-30
Scripting.cs
MigratedBookSleeveTestSuite/Scripting.cs
+15
-10
packages.config
MigratedBookSleeveTestSuite/packages.config
+1
-1
No files found.
MigratedBookSleeveTestSuite/Config.cs
View file @
64e597b9
...
@@ -122,25 +122,36 @@ public void CanOpenSecuredConnection()
...
@@ -122,25 +122,36 @@ public void CanOpenSecuredConnection()
}
}
}
}
[
Test
,
ExpectedException
(
typeof
(
RedisConnectionException
))
]
[
Test
]
public
void
CanNotOpenNonsenseConnection_IP
()
public
void
CanNotOpenNonsenseConnection_IP
()
{
Assert
.
Throws
<
RedisConnectionException
>(()
=>
{
{
var
log
=
new
StringWriter
();
var
log
=
new
StringWriter
();
try
{
try
{
using
(
var
conn
=
ConnectionMultiplexer
.
Connect
(
Config
.
LocalHost
+
":6500"
))
{
}
using
(
var
conn
=
ConnectionMultiplexer
.
Connect
(
Config
.
LocalHost
+
":6500"
))
{
}
}
finally
{
}
finally
{
Console
.
WriteLine
(
log
);
Console
.
WriteLine
(
log
);
}
}
});
}
}
[
Test
,
ExpectedException
(
typeof
(
RedisConnectionException
))]
[
Test
]
public
void
CanNotOpenNonsenseConnection_DNS
()
public
void
CanNotOpenNonsenseConnection_DNS
()
{
Assert
.
Throws
<
RedisConnectionException
>(()
=>
{
{
var
log
=
new
StringWriter
();
var
log
=
new
StringWriter
();
try
{
try
{
using
(
var
conn
=
ConnectionMultiplexer
.
Connect
(
"doesnot.exist.ds.aasd981230d.com:6500"
,
log
))
{
}
using
(
var
conn
=
ConnectionMultiplexer
.
Connect
(
"doesnot.exist.ds.aasd981230d.com:6500"
,
log
))
{
}
}
finally
{
}
finally
{
Console
.
WriteLine
(
log
);
Console
.
WriteLine
(
log
);
}
}
});
}
}
[
Test
]
[
Test
]
...
...
MigratedBookSleeveTestSuite/Issues/SO10504853.cs
View file @
64e597b9
...
@@ -55,8 +55,10 @@ public void ExecuteWithEmptyStartingPoint()
...
@@ -55,8 +55,10 @@ public void ExecuteWithEmptyStartingPoint()
}
}
}
}
[
Test
,
ExpectedException
(
typeof
(
RedisServerException
),
ExpectedMessage
=
"WRONGTYPE Operation against a key holding the wrong kind of value"
)
]
[
Test
]
public
void
ExecuteWithNonHashStartingPoint
()
public
void
ExecuteWithNonHashStartingPoint
()
{
Assert
.
Throws
<
RedisConnectionException
>(()
=>
{
{
using
(
var
muxer
=
Config
.
GetUnsecuredConnection
())
using
(
var
muxer
=
Config
.
GetUnsecuredConnection
())
{
{
...
@@ -72,11 +74,14 @@ public void ExecuteWithNonHashStartingPoint()
...
@@ -72,11 +74,14 @@ public void ExecuteWithNonHashStartingPoint()
{
{
conn
.
Wait
(
taskResult
);
conn
.
Wait
(
taskResult
);
Assert
.
Fail
();
Assert
.
Fail
();
}
catch
(
AggregateException
ex
)
}
catch
(
AggregateException
ex
)
{
{
throw
ex
.
InnerExceptions
[
0
];
throw
ex
.
InnerExceptions
[
0
];
}
}
}
}
},
message
:
"WRONGTYPE Operation against a key holding the wrong kind of value"
);
}
}
}
}
}
}
MigratedBookSleeveTestSuite/MigratedBookSleeveTestSuite.csproj
View file @
64e597b9
...
@@ -44,9 +44,9 @@
...
@@ -44,9 +44,9 @@
<CodeAnalysisRuleSet>
MinimumRecommendedRules.ruleset
</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet>
MinimumRecommendedRules.ruleset
</CodeAnalysisRuleSet>
</PropertyGroup>
</PropertyGroup>
<ItemGroup>
<ItemGroup>
<Reference
Include=
"nunit.framework, Version=
2.6.4.14350, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77
, processorArchitecture=MSIL"
>
<Reference
Include=
"nunit.framework, Version=
3.0.5715.30856, Culture=neutral, PublicKeyToken=2638cd05610744eb
, processorArchitecture=MSIL"
>
<
SpecificVersion>
False
</SpecificVersion
>
<
HintPath>
..\packages\NUnit.3.0.0-beta-5\lib\net45\nunit.framework.dll
</HintPath
>
<
HintPath>
..\packages\NUnit.2.6.4\lib\nunit.framework.dll
</HintPath
>
<
Private>
True
</Private
>
</Reference>
</Reference>
<Reference
Include=
"System"
/>
<Reference
Include=
"System"
/>
<Reference
Include=
"System.Core"
/>
<Reference
Include=
"System.Core"
/>
...
...
MigratedBookSleeveTestSuite/Program.cs
View file @
64e597b9
...
@@ -100,7 +100,6 @@ where Attribute.IsDefined(method, typeof(TestAttribute))
...
@@ -100,7 +100,6 @@ where Attribute.IsDefined(method, typeof(TestAttribute))
foreach
(
var
test
in
tests
)
foreach
(
var
test
in
tests
)
{
{
var
expectedFail
=
Attribute
.
GetCustomAttribute
(
test
,
typeof
(
ExpectedExceptionAttribute
))
as
ExpectedExceptionAttribute
;
Console
.
Write
(
test
.
Name
+
": "
);
Console
.
Write
(
test
.
Name
+
": "
);
Exception
err
=
null
;
Exception
err
=
null
;
...
@@ -131,35 +130,6 @@ where Attribute.IsDefined(method, typeof(TestAttribute))
...
@@ -131,35 +130,6 @@ where Attribute.IsDefined(method, typeof(TestAttribute))
err
=
((
AggregateException
)
err
).
InnerExceptions
[
0
];
err
=
((
AggregateException
)
err
).
InnerExceptions
[
0
];
}
}
if
(
expectedFail
!=
null
)
{
if
(
err
==
null
)
{
err
=
new
NUnit
.
Framework
.
AssertionException
(
"failed to fail"
);
}
else
{
int
issues
=
0
;
if
(
expectedFail
.
ExpectedException
!=
null
&&
!
expectedFail
.
ExpectedException
.
IsAssignableFrom
(
err
.
GetType
()))
{
issues
++;
}
if
(
expectedFail
.
ExpectedExceptionName
!=
null
&&
err
.
GetType
().
FullName
!=
expectedFail
.
ExpectedExceptionName
)
{
issues
++;
}
if
(
expectedFail
.
ExpectedMessage
!=
null
&&
err
.
Message
!=
expectedFail
.
ExpectedMessage
)
{
issues
++;
}
if
(
issues
==
0
)
err
=
null
;
else
{
err
=
new
InvalidOperationException
(
"Failed in a different way"
,
err
);
}
}
}
if
(
err
==
null
)
if
(
err
==
null
)
{
{
Console
.
WriteLine
(
"pass"
);
Console
.
WriteLine
(
"pass"
);
...
...
MigratedBookSleeveTestSuite/Scripting.cs
View file @
64e597b9
...
@@ -264,8 +264,10 @@ public void NonAsciiScripts()
...
@@ -264,8 +264,10 @@ public void NonAsciiScripts()
}
}
}
}
[
Test
,
ExpectedException
(
typeof
(
RedisServerException
),
ExpectedMessage
=
"oops"
)
]
[
Test
]
public
void
ScriptThrowsError
()
public
void
ScriptThrowsError
()
{
Assert
.
Throws
<
RedisServerException
>(()
=>
{
{
using
(
var
muxer
=
GetScriptConn
())
using
(
var
muxer
=
GetScriptConn
())
{
{
...
@@ -274,11 +276,14 @@ public void ScriptThrowsError()
...
@@ -274,11 +276,14 @@ public void ScriptThrowsError()
try
try
{
{
conn
.
Wait
(
result
);
conn
.
Wait
(
result
);
}
catch
(
AggregateException
ex
)
}
catch
(
AggregateException
ex
)
{
{
throw
ex
.
InnerExceptions
[
0
];
throw
ex
.
InnerExceptions
[
0
];
}
}
}
}
},
message
:
"oops"
);
}
}
[
Test
]
[
Test
]
...
...
MigratedBookSleeveTestSuite/packages.config
View file @
64e597b9
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
packages
>
<
packages
>
<
package
id
=
"NUnit"
version
=
"
2.6.4
"
targetFramework
=
"net45"
/>
<
package
id
=
"NUnit"
version
=
"
3.0.0-beta-5
"
targetFramework
=
"net45"
/>
</
packages
>
</
packages
>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment