1
0
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:
Oliver Booth 2020-04-19 16:16:28 +01:00
parent 30e53b2cec
commit 430eadee57
No known key found for this signature in database
GPG Key ID: 0D7F2EF1C8D2B9C0

View 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);
}
}
}