Skip to content

Commit

Permalink
Add tests in ApiTests
Browse files Browse the repository at this point in the history
  • Loading branch information
mushketyk committed Mar 4, 2017
1 parent 75f96f4 commit 39b2726
Showing 1 changed file with 26 additions and 4 deletions.
30 changes: 26 additions & 4 deletions Tests/API/ApiTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,25 +68,47 @@ public void Projects_CanBeCreatedAndDeleted_Successfully()
}

/// <summary>
/// Test successfully authenticating with the API using valid credentials.
/// Test successfully authenticating with the ApiConnection using valid credentials.
/// </summary>
[Test]
public void ApiWillAuthenticate_ValidCredentials_Successfully()
public void ApiConnectionWillAuthenticate_ValidCredentials_Successfully()
{
var connection = new ApiConnection(_testAccount, _testToken);
Assert.IsTrue(connection.Connected);
}

/// <summary>
/// Test that the Api will reject invalid credentials
/// Test successfully authenticating with the API using valid credentials.
/// </summary>
[Test]
public void ApiWillAuthenticate_InvalidCredentials_Unsuccessfully()
public void ApiWillAuthenticate_ValidCredentials_Successfully()
{
var api = new Api.Api();
api.Initialize(_testAccount, _testToken, _dataFolder);
Assert.IsTrue(api.Connected);
}

/// <summary>
/// Test that the ApiConnection will reject invalid credentials
/// </summary>
[Test]
public void ApiConnectionWillAuthenticate_InvalidCredentials_Unsuccessfully()
{
var connection = new ApiConnection(_testAccount, "");
Assert.IsFalse(connection.Connected);
}

/// <summary>
/// Test that the Api will reject invalid credentials
/// </summary>
[Test]
public void ApiWillAuthenticate_InvalidCredentials_Unsuccessfully()
{
var api = new Api.Api();
api.Initialize(_testAccount, "", _dataFolder);
Assert.IsFalse(api.Connected);
}

/// <summary>
/// Test updating the files associated with a project
/// </summary>
Expand Down

0 comments on commit 39b2726

Please sign in to comment.