mirror of
https://github.com/oliverbooth/X10D
synced 2024-11-09 22:55:42 +00:00
✅ Add tests for StringExtensions
This commit is contained in:
parent
30e53b2cec
commit
430eadee57
34
X10D.Tests/src/StringTests.cs
Normal file
34
X10D.Tests/src/StringTests.cs
Normal file
@ -0,0 +1,34 @@
|
||||
namespace X10D.Tests
|
||||
{
|
||||
using System.Linq;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
/// <summary>
|
||||
/// Tests for <see cref="StringExtensions"/>.
|
||||
/// </summary>
|
||||
[TestClass]
|
||||
public class StringTests
|
||||
{
|
||||
/// <summary>
|
||||
/// Tests for <see cref="StringExtensions.Repeat"/>.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
public void Repeat()
|
||||
{
|
||||
Assert.AreEqual("foofoofoofoofoo", "foo".Repeat(5));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tests for <see cref="StringExtensions.Split"/>.
|
||||
/// </summary>
|
||||
[TestMethod]
|
||||
public void Split()
|
||||
{
|
||||
const string str = "Hello World";
|
||||
|
||||
// ReSharper disable once SuggestVarOrType_Elsewhere
|
||||
var arr = str.Split(2).ToArray();
|
||||
CollectionAssert.AreEqual(new[] { "He", "ll", "o ", "Wo", "rl", "d" }, arr);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user