Esempio n. 1
0
        //[TestCase("screen1", "control1", "SelectAll_DR", "SQL%individual%static%-", "User1", "Hostname1", "RC")]
        //[TestCase("screen2", "control2", "SelectAll_DR", "SQL%individual%dynamic%-", "User2", "Hostname2", "RC")]
        //[TestCase("screen3", "control3", "SelectAll_DR", "SQL%common%static%-", "User3", "Hostname3", "RC")]
        //[TestCase("screen4", "control4", "SelectAll_DR", "SQL%common%dynamic%-", "User4", "Hostname4", "RC")]
        //[TestCase("screen5", "control5", "SelectAll_DR", "SQL%generate%static%-", "User5", "Hostname5", "RC")]
        //[TestCase("screen6", "control6", "SelectAll_DR", "SQL%generate%dynamic%-", "User6", "Hostname6", "RC")]
        public void _2_SelectAll_XX(
            string screenId, string controlId,
            string methodName, string actionType,
            string userName, string ipAddress, string isolationLevel)
        {
            // 引数クラスを生成
            // 下位(B・D層)は、テスト クラスを流用する
            TestParameterValue testParameterValue
                = new TestParameterValue(
                    screenId, controlId, methodName, actionType, new MyUserInfo(userName, ipAddress));

            // 戻り値
            TestReturnValue testReturnValue = null; ;

            // B層呼出し
            LayerB layerB = new LayerB();

            try
            {
                testReturnValue = (TestReturnValue)layerB.DoBusinessLogic(
                    testParameterValue, this.SelectIsolationLevel(isolationLevel));
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }

            // 戻り値検証。
            Assert.AreEqual(testReturnValue.ErrorFlag, false);

            switch (methodName)
            {
                case "SelectAll_DT":
                    DataTable dt = (DataTable)testReturnValue.Obj;
                    Assert.GreaterOrEqual(dt.Rows.Count, 1);
                    break;
                case "SelectAll_DS":
                    DataSet ds = (DataSet)testReturnValue.Obj;
                    Assert.AreEqual(ds.Tables.Count, 1);
                    Assert.GreaterOrEqual(ds.Tables[0].Rows.Count, 1);
                    break;
                case "SelectAll_DR":
                    break;
                default:
                    break;

            }
        }
Esempio n. 2
0
        public void _1_SelectCount(
            string screenId, string controlId, string actionType,
            string userName, string ipAddress, string isolationLevel)
        {
            string methodName = "SelectCount";

            // 引数クラスを生成
            // 下位(B・D層)は、テスト クラスを流用する
            TestParameterValue testParameterValue
                = new TestParameterValue(
                    screenId, controlId, methodName, actionType, new MyUserInfo(userName, ipAddress));

            // 戻り値
            TestReturnValue testReturnValue = null; ;

            // B層呼出し
            LayerB layerB = new LayerB();
            
            try
            {
                testReturnValue = (TestReturnValue)layerB.DoBusinessLogic(
                    testParameterValue, this.SelectIsolationLevel(isolationLevel));
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }

            // 戻り値検証。
            Assert.AreEqual(testReturnValue.ErrorFlag, false);
            Assert.AreEqual(StringChecker.IsNumbers(testReturnValue.Obj.ToString()), true);
        }