Skip to content

Commit

Permalink
add expectedexception attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
quantumdot committed May 3, 2019
1 parent 5c38fde commit abc0525
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions SynapseToolsTests/TestSynapseApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public TestSynapseApi()
this.client = SynapseClient.GetClient();
}

[TestMethod]
[TestMethod, ExpectedException(typeof(AggregateException))]
public void TestModeToggle()
{
Assert.AreEqual(SynapseMode.Idle, this.client.Mode);
Expand All @@ -25,17 +25,17 @@ public void TestModeToggle()
this.client.Mode = SynapseMode.Idle;
Assert.AreEqual(SynapseMode.Idle, this.client.Mode);
}
[TestMethod]
[TestMethod, ExpectedException(typeof(AggregateException))]
public void TestMethod2()
{
Assert.AreEqual("Best", this.client.GetPersistMode());
}
[TestMethod]
[TestMethod, ExpectedException(typeof(AggregateException))]
public void TestMethod3()
{
CollectionAssert.AreEqual(new List<string>() { "Best", "Last", "Fresh" }, this.client.GetPersistModes());
}
[TestMethod]
[TestMethod, ExpectedException(typeof(AggregateException))]
public void TestApiSurface()
{
var m = this.client.Mode;
Expand Down
5 changes: 3 additions & 2 deletions SynapseToolsTests/TestTdtUdp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SynapseTools;
using System.Linq;
using System.Net.Sockets;

namespace SynapseToolsTests
{
Expand All @@ -21,7 +22,7 @@ public void TestCreateClient()
{
var client = new TdtUdp("localhost");
}
[TestMethod]
[TestMethod, ExpectedException(typeof(SocketException))]
public void TestSendData()
{
int iterations = 100;
Expand All @@ -41,7 +42,7 @@ public void TestSendData()
}
}

[TestMethod]
[TestMethod, ExpectedException(typeof(SocketException))]
public void TestReceiveData()
{
int iterations = 1000;
Expand Down

0 comments on commit abc0525

Please sign in to comment.