-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merging pull request #19 from stevenvolckaert/vNext
Merging vNext into master.
- Loading branch information
Showing
12 changed files
with
455 additions
and
311 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
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
39 changes: 19 additions & 20 deletions
39
test/StevenVolckaert.Core.Tests/ICollectionExtensionsTests.cs
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,45 +1,44 @@ | ||
namespace StevenVolckaert.Tests | ||
{ | ||
using System.Collections.Generic; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
using Xunit; | ||
|
||
[TestClass] | ||
public class ICollectionExtensionsTests | ||
{ | ||
[TestMethod] | ||
[Fact] | ||
public void AddRangeTest() | ||
{ | ||
var source = new List<string> { "foo", "bar", "baz" }; | ||
var other = new List<string> { "bar", "foo", "qux" }; | ||
var expected = new List<string> { "foo", "bar", "baz", "bar", "foo", "qux" }; | ||
var subject = new List<string> { "foo", "bar", "baz" }; | ||
var other = new string[] { "bar", "foo", "qux" }; | ||
var expected = new string[] { "foo", "bar", "baz", "bar", "foo", "qux" }; | ||
|
||
source.AddRange(other); | ||
subject.AddRange(other); | ||
|
||
CollectionAssert.AreEqual(expected, source); | ||
Assert.Equal(expected, subject); | ||
} | ||
|
||
[TestMethod] | ||
[Fact] | ||
public void AddRangeIndistinctTest() | ||
{ | ||
var source = new List<string> { "foo", "bar", "baz" }; | ||
var other = new List<string> { "bar", "foo", "qux" }; | ||
var expected = new List<string> { "foo", "bar", "baz", "bar", "foo", "qux" }; | ||
var subject = new List<string> { "foo", "bar", "baz" }; | ||
var other = new string[] { "bar", "foo", "qux" }; | ||
var expected = new string[] { "foo", "bar", "baz", "bar", "foo", "qux" }; | ||
|
||
source.AddRange(other, isDistinct: false); | ||
subject.AddRange(other, isDistinct: false); | ||
|
||
CollectionAssert.AreEqual(expected, source); | ||
Assert.Equal(expected, subject); | ||
} | ||
|
||
[TestMethod] | ||
[Fact] | ||
public void AddRangeDistinctTest() | ||
{ | ||
var source = new List<string> { "foo", "bar", "baz" }; | ||
var other = new List<string> { "bar", "foo", "qux" }; | ||
var expected = new List<string> { "foo", "bar", "baz", "qux" }; | ||
var subject = new List<string> { "foo", "bar", "baz" }; | ||
var other = new string[] { "bar", "foo", "qux" }; | ||
var expected = new string[] { "foo", "bar", "baz", "qux" }; | ||
|
||
source.AddRange(other, isDistinct: true); | ||
subject.AddRange(other, isDistinct: true); | ||
|
||
CollectionAssert.AreEqual(expected, source); | ||
Assert.Equal(expected, subject); | ||
} | ||
} | ||
} |
Oops, something went wrong.