This repository has been archived by the owner on Sep 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c18d5fb
commit a9a5769
Showing
1 changed file
with
11 additions
and
7 deletions.
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 |
---|---|---|
@@ -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) | ||
); | ||
} | ||
} | ||
} | ||
} |