Example #1
0
        public void Select_아이디나_패스워드_중_하나를_Null값_이나_빈값_입력시_Exception_발생하는지(string id, string password)
        {
            MockRepository mocks  = new MockRepository();
            UserInfo       _param = mocks.Stub <UserInfo>();

            _param.id       = id;
            _param.password = password;
            _param.userAuth = null;
            _param.userType = 사용자등급.일반사용자;
            IDataModel           stubDataModel    = mocks.Stub <SQLDataServiceModel>();
            IDataQueryRepository stubQueryReposit = mocks.Stub <SQLDataQueryRepository>();
            UserAuthController   uac = new UserAuthController(stubDataModel, stubQueryReposit);

            uac.Select(_param);
        }
Example #2
0
        public void Select_Test_파라미터가_없는_Select메서드_테스트()
        {
            MockRepository mocks = new MockRepository();
            //[1] IDataModel 파라미터 구성
            SQLDataServiceModel mockDataModel     = mocks.DynamicMock <SQLDataServiceModel>();
            ISQLWebService      stubSQLWebService = mocks.Stub <ISQLWebService>(mocks.Stub <InstanceContext>());

            mockDataModel.EncryptionSeed = "1234";
            mockDataModel.sqlService     = stubSQLWebService;

            //[2] IDataQueryRepository 파라미터 구성
            IDataQueryRepository stubQueryReposit = mocks.Stub <SQLDataQueryRepository>();

            //[3] stub과 mock객체 사용해서 테스트 하고자 하는 객체 생성
            UserAuthController uac = new UserAuthController(mockDataModel, stubQueryReposit);

            using (mocks.Record())
            {
                string query = stubQueryReposit.SelectUserAuth();
                mockDataModel.GetData(query);
            }
            uac.Select();
            mocks.Verify(mockDataModel);
        }
Example #3
0
 public void Select_아이디나_패스워드_중_하나를_Null값_이나_빈값_입력시_Exception_발생하는지(string id,string password)
 {
     MockRepository mocks = new MockRepository();
     UserInfo _param = mocks.Stub<UserInfo>();
              _param.id = id;
              _param.password = password;
              _param.userAuth = null;
              _param.userType = 사용자등급.일반사용자;
     IDataModel stubDataModel = mocks.Stub<SQLDataServiceModel>();
     IDataQueryRepository stubQueryReposit = mocks.Stub<SQLDataQueryRepository>();
     UserAuthController uac = new UserAuthController(stubDataModel,stubQueryReposit);
     uac.Select(_param);
 }
Example #4
0
        public void Select_Test_파라미터가_없는_Select메서드_테스트()
        {
            MockRepository mocks = new MockRepository();
            //[1] IDataModel 파라미터 구성
            SQLDataServiceModel mockDataModel = mocks.DynamicMock<SQLDataServiceModel>();
            ISQLWebService stubSQLWebService = mocks.Stub<ISQLWebService>(mocks.Stub<InstanceContext>());
            mockDataModel.EncryptionSeed = "1234";
            mockDataModel.sqlService = stubSQLWebService;

            //[2] IDataQueryRepository 파라미터 구성
            IDataQueryRepository stubQueryReposit = mocks.Stub<SQLDataQueryRepository>();

            //[3] stub과 mock객체 사용해서 테스트 하고자 하는 객체 생성
            UserAuthController uac = new UserAuthController(mockDataModel, stubQueryReposit);
            using (mocks.Record())
            {
                string query = stubQueryReposit.SelectUserAuth();
                mockDataModel.GetData(query);
            }
            uac.Select();
            mocks.Verify(mockDataModel);
        }