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
Showing
4 changed files
with
60 additions
and
0 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
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using System; | ||
using Xunit; | ||
|
||
namespace UriTemplateString.Tests | ||
{ | ||
public class InvalidUriTemplateFixture | ||
{ | ||
[Fact] | ||
public void Should_throw_when_created_from_empty_string() | ||
{ | ||
Assert.Throws<ArgumentException>(() => new UriTemplateString(string.Empty)); | ||
} | ||
|
||
[Fact] | ||
public void Should_throw_when_created_from_template_with_unclosed_expression() | ||
{ | ||
Assert.Throws<ArgumentException>(() => new UriTemplateString("{/unclosed")); | ||
} | ||
|
||
[Fact] | ||
public void Should_throw_when_created_from_template_with_unsupported_expression_operator() | ||
{ | ||
Assert.Throws<ArgumentException>(() => new UriTemplateString("{'unclosed}")); | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using System; | ||
using UriTemplateString.Spec; | ||
using Xunit; | ||
|
||
namespace UriTemplateString.Tests | ||
{ | ||
public class OperatorFixture | ||
{ | ||
[Fact] | ||
public void Should_throw_when_constructed_with_unsupported_operator_character() | ||
{ | ||
Assert.Throws<ArgumentOutOfRangeException>(() => Operator.FromString("_")); | ||
} | ||
|
||
[Theory] | ||
[InlineData("=")] | ||
[InlineData(",")] | ||
[InlineData("!")] | ||
[InlineData("@")] | ||
[InlineData("|")] | ||
public void Should_throw_when_constructed_with_operator_reserved_for_future_use(string op) | ||
{ | ||
Assert.Throws<NotImplementedException>(() => Operator.FromString(op)); | ||
} | ||
} | ||
} |
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