Skip to content

Commit

Permalink
Added a test
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashley Medway committed Jul 15, 2016
1 parent ecfed4f commit fef9bb0
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 1 deletion.
1 change: 1 addition & 0 deletions MailJet.Client.Tests/MailJet.Client.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
<Compile Include="GetMessages.cs" />
<Compile Include="SendMail.cs" />
<Compile Include="AccountTests.cs" />
<Compile Include="StatisticsTests.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
Expand Down
42 changes: 42 additions & 0 deletions MailJet.Client.Tests/StatisticsTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MailJet.Client.Tests
{
[TestFixture]
public class StatisticsTests
{
private MailJetClient _client;

[SetUp]
public void Setup()
{
#if DEBUG
var publicKey = Environment.GetEnvironmentVariable("MailJetPub", EnvironmentVariableTarget.User);
var privateKey = Environment.GetEnvironmentVariable("MailJetPri", EnvironmentVariableTarget.User);
#else
var publicKey = Environment.GetEnvironmentVariable("MailJetPub");
var privateKey = Environment.GetEnvironmentVariable("MailJetPri");
#endif


if (String.IsNullOrWhiteSpace(publicKey))
throw new InvalidOperationException("Add your MailJet public API Key to the Environment Variable \"MailJetPub\".");
if (String.IsNullOrWhiteSpace(privateKey))
throw new InvalidOperationException("Add your MailJet private API Key to the Environment Variable \"MailJetPri\".");

_client = new MailJetClient(publicKey, privateKey);
}

[Test]
public void GetAggregateGraphStatistics()
{
var result = _client.GetAggregateGraphStatistics();
Assert.IsNotNull(result);
}
}
}
2 changes: 1 addition & 1 deletion MailJetClient/Response/Data/AggregateGraphStatistics.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace MailJet.Client.Response.Data
{
public class AggregateGraphStatistics: DataItem
public class AggregateGraphStatistics : DataItem
{
/// <summary>
/// Number of blocked messages.
Expand Down

0 comments on commit fef9bb0

Please sign in to comment.