using Microsoft.VisualStudio.TestTools.UnitTesting;
|
using System;
|
using System.Collections.Generic;
|
|
namespace iWareUnitTest
|
{
|
[TestClass]
|
public class CSharpTest
|
{
|
/// <summary>
|
/// 测试 回车换行
|
/// </summary>
|
[TestMethod]
|
public void Test_Centerl()
|
{
|
string str = "XXX\r\n";
|
|
Console.WriteLine(str);
|
|
//消除回车
|
str = str.Trim();
|
var bb = "";
|
|
|
}
|
|
/// <summary>
|
/// 测试 写入异常对象
|
/// </summary>
|
[TestMethod]
|
public void Test_RemoveList()
|
{
|
List<string> _list = new List<string>() {
|
"11","22","33"
|
};
|
|
_list.RemoveAll(x => x == "11");
|
|
Console.WriteLine(_list);
|
}
|
|
/// <summary>
|
/// 测试 Contains
|
/// </summary>
|
[TestMethod]
|
public void Test_ListContianer()
|
{
|
List<string> _list = new List<string>() {
|
"11","22","33"
|
};
|
|
var aa = _list.Contains("1");
|
var bb = _list.Contains("11");
|
|
Console.WriteLine(aa);
|
}
|
}
|
}
|