public void TestToString() { GenericData data = null; //使用ToString()将抛出异常 Assert.AreEqual(string.Empty, data.ToStringSafely()); }