Exemplo n.º 1
0
        public void GetProcClassResultTestCs()
        {
            // out params
            long     outParamBigInt; byte[] outParamBinary; bool?outParamBit; string outParamChar;
            DateTime outParamDateTime; decimal?outParamDecimal; double outParamFloat;
            int?     outParamInt; decimal outParamMoney; string outParamNChar;
            string   outParamNVarChar; float?outParamReal;
            Guid     outParamUniqueIdentifier; DateTime?outParamSmallDateTime; short outParamSmallInt;
            decimal? outParamSmallMoney; byte[] outParamTimestamp;
            byte     outParamTinyInt; byte[] outParamVarBinary; string outParamVarChar;
            string   outParamXml; DateTime?outParamDate; TimeSpan outParamTime;
            DateTime?outParamDateTime2; DateTimeOffset outParamDateTimeOffset;
            // ref params
            long     inOutParamBigInt = -10101; byte[] inOutParamBinary = new byte[4];
            bool?    inOutParamBit = false; string inOutParamChar = "Z"; DateTime inOutParamDateTime = DateTime.Now;
            decimal? inOutParamDecimal = -1110; double inOutParamFloat = -5;
            int?     inOutParamInt = -9; decimal inOutParamMoney = -10; string inOutParamNChar = "X";
            string   inOutParamNVarChar = "V"; float?inOutParamReal = -15;
            Guid     inOutParamUniqueIdentifier = Guid.NewGuid(); DateTime?inOutParamSmallDateTime = DateTime.Now;
            short    inOutParamSmallInt = -11; decimal?inOutParamSmallMoney = -12;
            byte     inOutParamTinyInt = 3; byte[] inOutParamVarBinary = new byte[3];
            string   inOutParamVarChar = "B"; string inOutParamXml = "<ElementOut>elementOut</ElementOut>";
            DateTime?inOutParamDate = DateTime.Now; TimeSpan inOutParamTime = new TimeSpan(3);
            DateTime?inOutParamDateTime2 = new DateTime(1242143234); DateTimeOffset inOutParamDateTimeOffset = DateTimeOffset.Now;
            int      inOutParamUpdatedBy = -11;

            ProcClassResult result = DalApiTestDB.RunProc.GetProcClassResult(2, 10000L, new byte[10], true,
                                                                             "a", DateTime.Today, -125.25M, .37F, new byte[100], -1, (decimal)1.27, "b", "charly", "delta", 0.39F, Guid.NewGuid(),
                                                                             DateTime.Now.AddDays(-1), (short)43, 34525, "echo", (byte?)5, new byte[100], "gamma",
                                                                             "<Element>element</Element>", CreateIntBitValuePairTable("TestDataTable"), DateTime.Now, new TimeSpan(12345),
                                                                             DateTime.Today, new DateTimeOffset(DateTime.Now), 157, DateTime.Today.AddMinutes(15), "YY",
                                                                             out inOutParamUpdatedBy, "Test Manifest", out outParamBigInt, out outParamBinary, out outParamBit,
                                                                             out outParamChar, out outParamDateTime, out outParamDecimal, out outParamFloat, out outParamInt,
                                                                             out outParamMoney, out outParamNChar, out outParamNVarChar, out outParamReal, out outParamUniqueIdentifier,
                                                                             out outParamSmallDateTime, out outParamSmallInt, out outParamSmallMoney, out outParamTimestamp, out outParamTinyInt,
                                                                             out outParamVarBinary, out outParamVarChar, out outParamXml, out outParamDate,
                                                                             out outParamTime, out outParamDateTime2, out outParamDateTimeOffset, ref inOutParamBigInt,
                                                                             ref inOutParamBinary, ref inOutParamBit, ref inOutParamChar, ref inOutParamDateTime,
                                                                             ref inOutParamDecimal, ref inOutParamFloat, ref inOutParamInt, ref inOutParamMoney,
                                                                             ref inOutParamNChar, ref inOutParamNVarChar, ref inOutParamReal, ref inOutParamUniqueIdentifier,
                                                                             ref inOutParamSmallDateTime, ref inOutParamSmallInt, ref inOutParamSmallMoney,
                                                                             ref inOutParamTinyInt, ref inOutParamVarBinary, ref inOutParamVarChar,
                                                                             ref inOutParamXml, ref inOutParamDate, ref inOutParamTime, ref inOutParamDateTime2,
                                                                             ref inOutParamDateTimeOffset);

            Assert.IsNotNull(result, "GetProcClassResultTestCs() must not be NULL");
            Assert.AreEqual(result.ResultXml, "<ParamXml2>Param Xml 2</ParamXml2>", "GetProcClassResultTestCs().ResultXml value does not match");
            Assert.AreEqual(outParamXml, "<ElementOut>elementOut</ElementOut>", "GetProcClassResultTestCs().outParamXml value does not match");
            Assert.AreEqual(inOutParamXml, "<Element>element</Element>", "GetProcClassResultTestCs().inOutParamXml value does not match");
            Assert.AreEqual(inOutParamDecimal, -125.25M, "GetProcClassResultTestCs().inOutParamDecimal value does not match");
        }
Exemplo n.º 2
0
        public void GetProcClassResultFailTestVb()
        {
            // out params
            long     outParamBigInt = default(long); byte[] outParamBinary = null; bool?outParamBit = null; string outParamChar = null;
            DateTime outParamDateTime = DateTime.MaxValue; decimal?outParamDecimal = null; double outParamFloat = default(double);
            int?     outParamInt = null; decimal outParamMoney = 9.999M; string outParamNChar = null;
            string   outParamNVarChar = null; float?outParamReal = null;
            Guid     outParamUniqueIdentifier = Guid.Empty; DateTime?outParamSmallDateTime = null; short outParamSmallInt = 9;
            decimal? outParamSmallMoney = null; byte[] outParamTimestamp = null;
            byte     outParamTinyInt = default(byte); byte[] outParamVarBinary = null; string outParamVarChar = null;
            string   outParamXml = null; DateTime?outParamDate = null; TimeSpan outParamTime = new TimeSpan(2500000);
            DateTime?outParamDateTime2 = null; DateTimeOffset outParamDateTimeOffset = default(DateTimeOffset);
            // ref params
            long     inOutParamBigInt = -10101; byte[] inOutParamBinary = new byte[4];
            bool?    inOutParamBit = false; string inOutParamChar = "Z"; DateTime inOutParamDateTime = DateTime.Now;
            decimal? inOutParamDecimal = -1110; double inOutParamFloat = -5;
            int?     inOutParamInt = -9; decimal inOutParamMoney = -10; string inOutParamNChar = "X";
            string   inOutParamNVarChar = "V"; float?inOutParamReal = -15;
            Guid     inOutParamUniqueIdentifier = Guid.NewGuid(); DateTime?inOutParamSmallDateTime = DateTime.Now;
            short    inOutParamSmallInt = -11; decimal?inOutParamSmallMoney = -12;
            byte     inOutParamTinyInt = 3; byte[] inOutParamVarBinary = new byte[3];
            string   inOutParamVarChar = "B"; string inOutParamXml = "<ElementOut>elementOut</ElementOut>";
            DateTime?inOutParamDate = DateTime.Now; TimeSpan inOutParamTime = new TimeSpan(3);
            DateTime?inOutParamDateTime2 = new DateTime(1242143234); DateTimeOffset inOutParamDateTimeOffset = DateTimeOffset.Now;
            int      inOutParamUpdatedBy = -11;

            ProcClassResult result = DalApiEvaluatetDB.RunProc.GetProcClassResult(-1, 10000L, new byte[10], true,
                                                                                  "a", DateTime.Today, -125, .37F, new byte[100], -1, (decimal)1.27, "b", "charly", "delta", 0.39F, Guid.NewGuid(),
                                                                                  DateTime.Now.AddDays(-1), (short)43, 34525, "echo", (byte?)5, new byte[100], "gamma",
                                                                                  "<Element>element</Element>", CreateIntBitValuePairEmptyTable("TestDataTable"), DateTime.Now, new TimeSpan(12345),
                                                                                  DateTime.Today, new DateTimeOffset(DateTime.Now), 157, DateTime.Today.AddMinutes(15), "YY",
                                                                                  ref inOutParamUpdatedBy, "Test Manifest", ref outParamBigInt, ref outParamBinary, ref outParamBit,
                                                                                  ref outParamChar, ref outParamDateTime, ref outParamDecimal, ref outParamFloat, ref outParamInt,
                                                                                  ref outParamMoney, ref outParamNChar, ref outParamNVarChar, ref outParamReal, ref outParamUniqueIdentifier,
                                                                                  ref outParamSmallDateTime, ref outParamSmallInt, ref outParamSmallMoney, ref outParamTimestamp, ref outParamTinyInt,
                                                                                  ref outParamVarBinary, ref outParamVarChar, ref outParamXml, ref outParamDate,
                                                                                  ref outParamTime, ref outParamDateTime2, ref outParamDateTimeOffset, ref inOutParamBigInt,
                                                                                  ref inOutParamBinary, ref inOutParamBit, ref inOutParamChar, ref inOutParamDateTime,
                                                                                  ref inOutParamDecimal, ref inOutParamFloat, ref inOutParamInt, ref inOutParamMoney,
                                                                                  ref inOutParamNChar, ref inOutParamNVarChar, ref inOutParamReal, ref inOutParamUniqueIdentifier,
                                                                                  ref inOutParamSmallDateTime, ref inOutParamSmallInt, ref inOutParamSmallMoney,
                                                                                  ref inOutParamTinyInt, ref inOutParamVarBinary, ref inOutParamVarChar,
                                                                                  ref inOutParamXml, ref inOutParamDate, ref inOutParamTime, ref inOutParamDateTime2,
                                                                                  ref inOutParamDateTimeOffset);

            Assert.IsNull(result, "GetProcClassResultFailTestVb() must be NULL");
        }