-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #394 from octokit/haacked/proper-readonly-collections
Make readonly collections truly readonly
- Loading branch information
Showing
9 changed files
with
102 additions
and
13 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
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,20 @@ | ||
using Octokit; | ||
using Octokit.Tests.Helpers; | ||
using Xunit; | ||
|
||
public class SearchCodeRequestTests | ||
{ | ||
public class TheMergedQualifiersMethod | ||
{ | ||
[Fact] | ||
public void ReturnsAReadOnlyDictionary() | ||
{ | ||
var request = new SearchCodeRequest("test"); | ||
|
||
var result = request.MergedQualifiers(); | ||
|
||
// If I can cast this to a writeable collection, then that defeats the purpose of a read only. | ||
AssertEx.IsReadOnlyCollection<string>(result); | ||
} | ||
} | ||
} |
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,20 @@ | ||
using Octokit; | ||
using Octokit.Tests.Helpers; | ||
using Xunit; | ||
|
||
internal class SearchIssuesRequestTests | ||
{ | ||
public class TheMergedQualifiersMethod | ||
{ | ||
[Fact] | ||
public void ReturnsAReadOnlyDictionary() | ||
{ | ||
var request = new SearchIssuesRequest("test"); | ||
|
||
var result = request.MergedQualifiers(); | ||
|
||
// If I can cast this to a writeable collection, then that defeats the purpose of a read only. | ||
AssertEx.IsReadOnlyCollection<string>(result); | ||
} | ||
} | ||
} |
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,20 @@ | ||
using Octokit; | ||
using Octokit.Tests.Helpers; | ||
using Xunit; | ||
|
||
internal class SearchUsersRequestTests | ||
{ | ||
public class TheMergedQualifiersMethod | ||
{ | ||
[Fact] | ||
public void ReturnsAReadOnlyDictionary() | ||
{ | ||
var request = new SearchUsersRequest("test"); | ||
|
||
var result = request.MergedQualifiers(); | ||
|
||
// If I can cast this to a writeable collection, then that defeats the purpose of a read only. | ||
AssertEx.IsReadOnlyCollection<string>(result); | ||
} | ||
} | ||
} |
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