schangxiang@126.com
2025-09-17 ff43ddf18764629ff875478e4e47a7281cbd230a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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);
        }
    }
}