mirror of
https://github.com/MichaelGrafnetter/DSInternals
synced 2025-01-05 21:49:47 +00:00
38 lines
1.1 KiB
C#
38 lines
1.1 KiB
C#
|
using System;
|
|||
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|||
|
|
|||
|
namespace DSInternals.Common.Test
|
|||
|
{
|
|||
|
[TestClass]
|
|||
|
public class StringExtensionsTester
|
|||
|
{
|
|||
|
[TestMethod]
|
|||
|
public void StringExtensions_TrimEnd_Test1()
|
|||
|
{
|
|||
|
string input = "strsuffix";
|
|||
|
string result = input.TrimEnd("suffix");
|
|||
|
Assert.AreEqual("str", result);
|
|||
|
}
|
|||
|
[TestMethod]
|
|||
|
public void StringExtensions_TrimEnd_NullSuffix()
|
|||
|
{
|
|||
|
string input = "str";
|
|||
|
string result = input.TrimEnd(null);
|
|||
|
Assert.AreEqual("str", result);
|
|||
|
}
|
|||
|
[TestMethod]
|
|||
|
public void StringExtensions_TrimEnd_EmptySuffix()
|
|||
|
{
|
|||
|
string input = "str";
|
|||
|
string result = input.TrimEnd(string.Empty);
|
|||
|
Assert.AreEqual("str", result);
|
|||
|
}
|
|||
|
[TestMethod]
|
|||
|
public void StringExtensions_TrimEnd_EmptyInput()
|
|||
|
{
|
|||
|
string result = string.Empty.TrimEnd("suffix");
|
|||
|
Assert.AreEqual(string.Empty, result);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|