-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fixes #201, removes unused using statements * Fixed unit tests * Removed obsolete items * Reduced assemblies scanned for routes * Removes unused using statements in test project
- Loading branch information
1 parent
0475f93
commit 73ea9f7
Showing
23 changed files
with
80 additions
and
361 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 |
---|---|---|
|
@@ -26,6 +26,7 @@ TestResult.xml | |
|
||
# Visual Studio 2015 cache/options directory | ||
.vs/ | ||
.vscode/ | ||
|
||
#SonarQube | ||
.sonarqube/ | ||
|
This file was deleted.
Oops, something went wrong.
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
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
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
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,56 +1,39 @@ | ||
using System; | ||
using System.Net; | ||
using Grapevine.Client; | ||
using Grapevine.Shared; | ||
using Shouldly; | ||
using Xunit; | ||
|
||
namespace Grapevine.Tests.Client | ||
{ | ||
public class RestClientFacts | ||
{ | ||
public class Constructors | ||
{ | ||
[Fact] | ||
public void BaseInitialization() | ||
{ | ||
const string baseurl = "http://localhost:1234/"; | ||
|
||
var client = new RestClient { Host = "localhost", Port = 1234, Scheme = UriScheme.Http }; | ||
|
||
client.BaseUrl.AbsoluteUri.ShouldBe(baseurl); | ||
client.Cookies.ShouldNotBeNull(); | ||
client.Credentials.ShouldBeNull(); | ||
} | ||
} | ||
|
||
public class Execute | ||
using System; | ||
using Grapevine.Client; | ||
using Grapevine.Shared; | ||
using Shouldly; | ||
using Xunit; | ||
|
||
namespace Grapevine.Tests.Client | ||
{ | ||
public class RestClientFacts | ||
{ | ||
public class Constructors | ||
{ | ||
[Fact] | ||
public void ClientRunsTimeoutDelegateOnRequestTimeoutIfSet() | ||
public void BaseInitialization() | ||
{ | ||
var actionCalled = false; | ||
Action updateActionCalled = () => actionCalled = true; | ||
|
||
var client = new RestClient { RequestTimeoutAction = updateActionCalled, | ||
Host = "localhost", Port = 1234, Scheme = UriScheme.Http }; | ||
|
||
var req = new RestRequest { Timeout = 1, ContentType = ContentType.MIME }; | ||
const string baseurl = "http://localhost:1234/"; | ||
|
||
client.Execute(req); | ||
var client = new RestClient { Host = "localhost", Port = 1234, Scheme = UriScheme.Http }; | ||
|
||
actionCalled.ShouldBeTrue(); | ||
client.BaseUrl.AbsoluteUri.ShouldBe(baseurl); | ||
client.Cookies.ShouldNotBeNull(); | ||
client.Credentials.ShouldBeNull(); | ||
} | ||
} | ||
|
||
public class Execute | ||
{ | ||
[Fact] | ||
public void ClientRethrowsExceptionIfNoTimeoutDelegateSetAndRequestTimesOut() | ||
{ | ||
var client = new RestClient { Host = "localhost", Port = 1234, Scheme = UriScheme.Http }; | ||
|
||
var req = new RestRequest { Timeout = 1, ContentType = ContentType.MIME }; | ||
|
||
Should.Throw<WebException>(() => client.Execute(req)); | ||
Should.Throw<Exception>(() => client.Execute(req)); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.