-
Notifications
You must be signed in to change notification settings - Fork 779
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
Nigel Sampson
committed
Jun 4, 2020
1 parent
84edd18
commit 69d5a09
Showing
2 changed files
with
63 additions
and
4 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 |
---|---|---|
@@ -0,0 +1,56 @@ | ||
using Xunit; | ||
|
||
namespace Caliburn.Micro.Platform.Tests | ||
{ | ||
public class StringSplitterTests | ||
{ | ||
[Fact] | ||
public void SplitSimpleString() | ||
{ | ||
var output = StringSplitter.Split("MyMethodName", ';'); | ||
|
||
Assert.Collection(output, o => Assert.Equal("MyMethodName", o)); | ||
} | ||
|
||
[Fact] | ||
public void SplitSeparatedString() | ||
{ | ||
var output = StringSplitter.Split("First;Second", ';'); | ||
|
||
Assert.Collection(output, | ||
o => Assert.Equal("First", o), | ||
o => Assert.Equal("Second", o)); | ||
} | ||
|
||
[Fact] | ||
public void TrimsSplitSimpleString() | ||
{ | ||
var output = StringSplitter.Split("MyMethodName ", ';'); | ||
|
||
Assert.Collection(output, o => Assert.Equal("MyMethodName", o)); | ||
} | ||
|
||
[Fact] | ||
public void RemovesEmptySplitsSeparatedString() | ||
{ | ||
var output = StringSplitter.Split("First;Second;", ';'); | ||
|
||
Assert.Collection(output, | ||
o => Assert.Equal("First", o), | ||
o => Assert.Equal("Second", o)); | ||
} | ||
|
||
[Fact] | ||
public void HandlesNewLinesInSeparatedString() | ||
{ | ||
var output = StringSplitter.Split(@" | ||
First; | ||
Second; | ||
", ';'); | ||
|
||
Assert.Collection(output, | ||
o => Assert.Equal("First", o), | ||
o => Assert.Equal("Second", o)); | ||
} | ||
} | ||
} |
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