예제 #1
0
    void TestEmptyOrNull()
    {
        CString str = new CString(0);

        if (CString.IsNullOrEmpty(null) && CString.IsNullOrEmpty(str))
        {
            Debug.Log("CString.IsNullOrEmpty(CString cs) ok");
        }
        else
        {
            Debug.LogError("CString.IsNullOrEmpty(CString cs) failed");
        }

        if (CString.IsNullOrWhiteSpace(null) && CString.IsNullOrWhiteSpace(" "))
        {
            Debug.Log("CString.IsNullOrWhiteSpace(CString cs) ok");
        }
        else
        {
            Debug.LogError("CString.IsNullOrWhiteSpace(CString cs) failed");
        }

        str = null;
        CString str1 = null;

        if (str == null && str == str1 && CString.Equals(str, null))
        {
            Debug.Log("CString compare to null ok");
        }
        else
        {
            Debug.LogError("CString compare to null failed");
        }
    }