mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-07 04:16:51 +00:00
added tests to catch regression
This commit is contained in:
@@ -22,6 +22,19 @@ namespace Octokit.Tests.Helpers
|
||||
Assert.Equal(new Uri("https://example.com?foo=foo%20val&bar=barval"), uriWithParameters);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ThrowsExceptionWhenNullValueProvided()
|
||||
{
|
||||
var uri = new Uri("https://example.com");
|
||||
|
||||
var parameters = new Dictionary<string, string>
|
||||
{
|
||||
{"foo", null },
|
||||
};
|
||||
|
||||
Assert.Throws<ArgumentNullException>(() => uri.ApplyParameters(parameters));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void AppendsParametersAsQueryStringToRelativeUri()
|
||||
{
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Octokit;
|
||||
using System;
|
||||
using Octokit;
|
||||
using Octokit.Tests.Helpers;
|
||||
using Xunit;
|
||||
|
||||
@@ -16,5 +17,13 @@ public class SearchCodeRequestTests
|
||||
// If I can cast this to a writeable collection, then that defeats the purpose of a read only.
|
||||
AssertEx.IsReadOnlyCollection<string>(result);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SortNotSpecifiedByDefault()
|
||||
{
|
||||
var request = new SearchCodeRequest("test");
|
||||
Assert.True(String.IsNullOrWhiteSpace(request.Sort));
|
||||
Assert.False(request.Parameters.ContainsKey("sort"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Octokit;
|
||||
using System;
|
||||
using Octokit;
|
||||
using Octokit.Tests.Helpers;
|
||||
using Xunit;
|
||||
|
||||
@@ -16,5 +17,13 @@ internal class SearchIssuesRequestTests
|
||||
// If I can cast this to a writeable collection, then that defeats the purpose of a read only.
|
||||
AssertEx.IsReadOnlyCollection<string>(result);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SortNotSpecifiedByDefault()
|
||||
{
|
||||
var request = new SearchIssuesRequest("test");
|
||||
Assert.True(String.IsNullOrWhiteSpace(request.Sort));
|
||||
Assert.False(request.Parameters.ContainsKey("sort"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Octokit;
|
||||
using System;
|
||||
using Octokit;
|
||||
using Octokit.Tests.Helpers;
|
||||
using Xunit;
|
||||
|
||||
@@ -16,5 +17,13 @@ internal class SearchUsersRequestTests
|
||||
// If I can cast this to a writeable collection, then that defeats the purpose of a read only.
|
||||
AssertEx.IsReadOnlyCollection<string>(result);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SortNotSpecifiedByDefault()
|
||||
{
|
||||
var request = new SearchUsersRequest("shiftkey");
|
||||
Assert.True(String.IsNullOrWhiteSpace(request.Sort));
|
||||
Assert.False(request.Parameters.ContainsKey("sort"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user