コード例 #1
0
ファイル: BsExceptionTests.cs プロジェクト: zhubin-12/32feet
        public void SoEx_UnknownBtSdkErrorCode()
        {
            BlueSoleilSocketException ex;

            ex = new BlueSoleilSocketException((BtSdkError)65099, (int)SocketError.NotSocket);
            Assert.AreEqual("0xFE4B", ex.BlueSoleilError, "BlueSoleilError");
            Assert.AreEqual(65099, ex.BlueSoleilErrorCode, "BlueSoleilErrorCode");
            //
            Assert.AreEqual(SocketError.NotSocket, ex.SocketErrorCode, "SocketErrorCode");
            Assert.AreEqual((int)SocketError.NotSocket, ex.ErrorCode, "ErrorCode");
            Assert.AreEqual((int)SocketError.NotSocket, ex.NativeErrorCode, "NativeErrorCode");
            // Just for historical tracking
            Assert.AreEqual("An operation was attempted on something that is not a socket"
                            + " (BlueSoleil: 65099 (0xFE4B)).",
                            ex.Message, "Message");
        }
コード例 #2
0
ファイル: BsExceptionTests.cs プロジェクト: zhubin-12/32feet
        public void SoEx_KnownBtSdkErrorCode()
        {
            BlueSoleilSocketException ex;

            ex = new BlueSoleilSocketException(BtSdkError.PAGE_TIMEOUT, SocketError.NotSocket);
            Assert.AreEqual("PAGE_TIMEOUT", ex.BlueSoleilError, "BlueSoleilError");
            Assert.AreEqual((int)BtSdkError.PAGE_TIMEOUT, ex.BlueSoleilErrorCode, "BlueSoleilErrorCode");
            //
            Assert.AreEqual(SocketError.NotSocket, ex.SocketErrorCode, "SocketErrorCode");
            Assert.AreEqual((int)SocketError.NotSocket, ex.ErrorCode, "ErrorCode");
            Assert.AreEqual((int)SocketError.NotSocket, ex.NativeErrorCode, "NativeErrorCode");
            // Just for historical tracking
            Assert.AreEqual("An operation was attempted on something that is not a socket"
                            + " (BlueSoleil: PAGE_TIMEOUT (0x0404)).",
                            ex.Message, "Message");
        }