-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Exception when accesssing Data twice on MailChimpException (#362)
* add MailchimpException test case * prevent dictionary exception with accessing Data twice on MailChimpException
- Loading branch information
1 parent
eb38dc7
commit 1cec263
Showing
2 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System.Net.Http; | ||
using System.Threading.Tasks; | ||
using MailChimp.Net.Core; | ||
using MailChimp.Net.Models; | ||
using Xunit; | ||
|
||
namespace MailChimp.Net.Tests | ||
{ | ||
public class ExceptionTest : MailChimpTest | ||
{ | ||
[Fact] | ||
public void Should_Return_Same_Data_On_Multiple_Calls() | ||
{ | ||
var exception = new MailChimpException(new MailChimpApiError(), new HttpResponseMessage()); | ||
|
||
var data1 = exception.Data; | ||
var data2 = exception.Data; | ||
|
||
Assert.Equal(data1, data2); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters