Skip to content
This repository has been archived by the owner on Sep 12, 2024. It is now read-only.

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
SamHutchings committed Nov 27, 2023
1 parent c18d5fb commit a9a5769
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions Duffel.ApiClient.Tests/ApiClientTests.cs
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
using NFluent;
using NUnit.Framework;

namespace Duffel.ApiClient.Tests
{
using System;
using NUnit.Framework;

public class DuffelApiClientTests
{
[Test]
public void ThrowsArgumentExceptionIfAccessTokenIsEmpty()
{
var exception = Assert.Catch<ArgumentException>(() => new DuffelApiClient(String.Empty));
Assert.AreEqual("No access token provided. To create an access token, head to your dashboard at https://app.duffel.com/duffel/tokens and generate a token. (Parameter 'accessToken')", exception?.Message);
var exception = Assert.Catch<ArgumentException>(() => new DuffelApiClient(string.Empty));
Assert.That(
"No access token provided. To create an access token, head to your dashboard at https://app.duffel.com/duffel/tokens and generate a token. (Parameter 'accessToken')",
Is.EqualTo(exception?.Message)
);
}

[Test]
public void ThrowsArgumentExceptionIfAccessTokenIsNull()
{
var exception = Assert.Catch<ArgumentException>(() => new DuffelApiClient(null));
Assert.AreEqual("No access token provided. To create an access token, head to your dashboard at https://app.duffel.com/duffel/tokens and generate a token. (Parameter 'accessToken')", exception?.Message);
Assert.That(
"No access token provided. To create an access token, head to your dashboard at https://app.duffel.com/duffel/tokens and generate a token. (Parameter 'accessToken')",
Is.EqualTo(exception?.Message)
);
}
}
}
}

0 comments on commit a9a5769

Please sign in to comment.