using Microsoft.VisualStudio.TestTools.UnitTesting; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Falcon.SugarApi; namespace Falcon.SugarApi.Test { [TestClass] public class StringExtendTest { [TestMethod] public void TestSplit() { var str = $"a,b.c;d,e。f;g"; var strArr = str.SplitStr(); Assert.AreEqual(7, strArr.Length, "分割后长度应该为7"); str = null; strArr = str.SplitStr(); Assert.IsNotNull(strArr); Assert.AreEqual(0, strArr.Length); } } }