public void Select_정상적으로_파라미터_입력시_정상적으로_쿼리생성_및_입력이_되는가() { //Arrange UserInfo _param = new UserInfo(); _param.id = "id"; _param.password = "******"; _param.userAuth = null; _param.userType = 사용자등급.일반사용자; MockRepository mocks = new MockRepository(); // [1] SQLDataServiceModel을 설정 SQLDataServiceModel mockSqlDB = mocks.DynamicMock <SQLDataServiceModel>(); mockSqlDB.sqlService = mocks.Stub <ISQLWebService>(new object[] { mocks.Stub <InstanceContext>() }); mockSqlDB.EncryptionSeed = "1234"; // [2] IDataQueryRepository를 설정 IDataQueryRepository stubQuery = mocks.Stub <SQLDataQueryRepository>(); // [3] 테스트 할 객체 생성 UserAuthController uac = new UserAuthController(mockSqlDB, stubQuery); using (mocks.Record()) { string query = stubQuery.SelectUserAuth(_param.id); mockSqlDB.GetData(query); } mocks.VerifyAll(); }
public Insert(MyCompanyProxyVO myCompany) : base("자신의 회사정보 입력", Hitpan5ClientLibrary.SQLDataServiceModel) { this.myCompany = myCompany; this.dbModel = Hitpan5ClientLibrary.SQLDataServiceModel; UserAuthProxyVO ua = new UserAuthProxyVO(); ua["나의정보관리"] = 사용자권한.모두허용; base.RequiredAuth = ua; }
public Insert(UserInfoProxyVO userinfo) : base(string.Format("아이디 {0} 입력", userinfo.UsersVO.UserID), Hitpan5ClientLibrary.SQLDataServiceModel) { this.userinfo = userinfo; this.dbModel = Hitpan5ClientLibrary.SQLDataServiceModel; UserAuthProxyVO ua = new UserAuthProxyVO(); ua["계정관리"] = 사용자권한.모두허용; base.RequiredAuth = ua; }
public SelectCommonSettings() : base("세팅정보 세팅", Hitpan5ClientLibrary.SQLDataServiceModel) { this.dbModel = Hitpan5ClientLibrary.SQLDataServiceModel; UserAuthProxyVO ua = new UserAuthProxyVO(); //실행에 필요한 권한 ua["설정관리"] = 사용자권한.조회만가능; base.RequiredAuth = ua; base.docController = new libHitpan5.Controller.Common.DocumentController.CommonSettingsDocument();//문서작성용 컨트롤러 }
public Insert(GoodDetailProxyVO GoodInfo) : base(string.Format("이름:{0} 규격{1}인 상품 정보 입력", GoodInfo.GoodsDetail.good_name, GoodInfo.GoodsDetail.good_subname), Hitpan5ClientLibrary.SQLDataServiceModel) { this.GoodInfo = GoodInfo; this.dbModel = Hitpan5ClientLibrary.SQLDataServiceModel; UserAuthProxyVO ua = new UserAuthProxyVO(); ua["상품정보"] = 사용자권한.모두허용; ua["표준관리"] = 사용자권한.모두허용; base.RequiredAuth = ua; }
public Update(CommonSettingProxyVO CommonSettinginfo, CommonSettingProxyVO pre_CommonSettinginfo) : base("기본설정 입력", Hitpan5ClientLibrary.SQLDataServiceModel) { this.CommonSettinginfo = CommonSettinginfo; this.pre_CommonSettinginfo = pre_CommonSettinginfo; this.dbModel = Hitpan5ClientLibrary.SQLDataServiceModel; UserAuthProxyVO ua = new UserAuthProxyVO(); ua["설정관리"] = 사용자권한.모두허용; base.RequiredAuth = ua; }
public SelectMyCompany() : base("나의 회사 정보 검색", Hitpan5ClientLibrary.SQLDataServiceModel) { this.dbModel = Hitpan5ClientLibrary.SQLDataServiceModel; UserAuthProxyVO ua = new UserAuthProxyVO(); //실행에 필요한 권한 ua["나의정보관리"] = 사용자권한.조회만가능; base.RequiredAuth = ua; base.docController = new libHitpan5.Controller.Common.DocumentController.MyCompanyDocument();//문서작성용 컨트롤러 }
public Update(UserInfoProxyVO post_userinfo, UserInfoProxyVO userinfo, string comment) : base(comment, Hitpan5ClientLibrary.SQLDataServiceModel) { this.dbModel = Hitpan5ClientLibrary.SQLDataServiceModel; this.userinfo = userinfo; this.post_userinfo = post_userinfo; UserAuthProxyVO ua = new UserAuthProxyVO(); ua["계정관리"] = 사용자권한.모두허용; base.RequiredAuth = ua; }
public void SetUp() { mocks = new MockRepository(); SQLDataServiceModel stubSQLlModel = mocks.Stub <SQLDataServiceModel>(); stubSQLlModel.sqlService = mocks.Stub <ISQLWebService>(mocks.Stub <InstanceContext>()); stubSQLlModel.EncryptionSeed = "1234"; mockListener = mocks.DynamicMock <UserAuthController>(); mockListener.sqlDBManager = stubSQLlModel; mockListener.query = mocks.Stub <SQLDataQueryRepository>(); }
public Update(GoodDetailProxyVO post_GoodInfo, GoodDetailProxyVO GoodInfo, string comment) : base(comment, Hitpan5ClientLibrary.SQLDataServiceModel) { this.GoodInfo = GoodInfo; this.post_GoodInfo = post_GoodInfo; this.dbModel = Hitpan5ClientLibrary.SQLDataServiceModel; UserAuthProxyVO ua = new UserAuthProxyVO(); ua["상품정보"] = 사용자권한.모두허용; ua["표준관리"] = 사용자권한.모두허용; base.RequiredAuth = ua; }
public void Setup() { mocks = new MockRepository(); SQLDataServiceModel dbModel = mocks.Stub <SQLDataServiceModel>(); dbModel.EncryptionSeed = "1234"; dbModel.sqlService = mocks.Stub <ISQLWebService>(mocks.Stub <InstanceContext>()); SQLDataQueryRepository sqlQueryHouse = mocks.Stub <SQLDataQueryRepository>(); LocalDataFileService LocalDataModel = mocks.Stub <LocalDataFileService>(); IDataQueryRepository LocalQueryHouse = mocks.Stub <LocalDataQueryRepository>(); object[] paramList = { dbModel, LocalDataModel, sqlQueryHouse, LocalQueryHouse }; mocksCMDListener = mocks.DynamicMock <WorkInfoController>(paramList); }
public void SetUp() { mocks = new MockRepository(); SQLDataServiceModel dbModel = mocks.DynamicMock <SQLDataServiceModel>(); dbModel.sqlService = mocks.Stub <ISQLWebService>(mocks.Stub <InstanceContext>()); dbModel.EncryptionSeed = "1234"; this.dbModel = dbModel; this.sqlQueryHouse = mocks.Stub <SQLDataQueryRepository>(); this.LocalModel = mocks.DynamicMock <LocalDataFileService>(); this.LocalQueryHouse = mocks.Stub <LocalDataQueryRepository>(); this.objectForTest = new WorkInfoController(dbModel, LocalModel, sqlQueryHouse, LocalQueryHouse); }
public void Delete_Test_파라미터_있는_메서드_파라미터로_Null값이나_빈값_입력__Exception발생(string id) { 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 stubQueryRepository = mocks.Stub <SQLDataQueryRepository>(); //[3] stub과 mock객체 사용해서 테스트 하고자 하는 객체 생성 UserAuthController uac = new UserAuthController(mockDataModel, stubQueryRepository); uac.Delete(id); }
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); }
public void Delete_Test_파라미터_있는_메서드__계정제한하는_쿼리_실행_시키는지(string id) { 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 stubQueryRepository = mocks.Stub <SQLDataQueryRepository>(); //[3] stub과 mock객체 사용해서 테스트 하고자 하는 객체 생성 UserAuthController uac = new UserAuthController(mockDataModel, stubQueryRepository); using (mocks.Record()) { string query = stubQueryRepository.DeleteUserInfo(id); mockDataModel.SetData(query); } uac.Delete(id); }
public UserListener(SQLDataServiceModel dataModel) { // TODO: Complete member initialization this.dataModel = dataModel; }
/// <summary> /// 라이브러리 시작 /// </summary> /// <param name="UseSecurityMode">wcf메시지 보안을 사용 할건지 말건지 </param> /// <param name="ServiceURL">접속 하고자 하는 주소</param> /// <param name="EncryptSeed">보안 시드키</param> /// <param name="id">로그인 id</param> /// <param name="password">로그인 패스워드</param> private Hitpan5ClientLibrary(bool UseSecurityMode, string ServiceURL, string EncryptSeed, string id, string password) { if (UseSecurityMode) { proxyController = new WebServiceProxyController(id, password, ServiceURL); } else { proxyController = new WebServiceProxyController(ServiceURL); } SQLDataServiceModel = new SQLDataServiceModel(EncryptSeed, ServiceURL, this.proxyController.proxy); //로그인 하기 (만약 아무것도 없으면 초기관리자 로서 모든 설정권한을 가짐: 빈 데이터 일 테니까 상관없다) 초기관리자는 계속 관리자 권한 갖는다 SelectUser su = new SelectUser(null); su.work = "처음 사용자인지 검증"; IList <UserInfoProxyVO> UserList = (IList <UserInfoProxyVO>)su.GetData(); if (UserList == null || UserList.Count == 0) { this.userInfo = new UserInfoProxyVO(); this.userInfo["UserID"] = "Admin"; this.userInfo["UserType"] = 사용자등급.관리자; this.userInfo["견적관리"] = 사용자권한.모두허용; this.userInfo["계정관리"] = 사용자권한.모두허용; this.userInfo["고객정보"] = 사용자권한.모두허용; this.userInfo["나의정보관리"] = 사용자권한.모두허용; this.userInfo["데이터관리"] = 사용자권한.모두허용; this.userInfo["매입관리"] = 사용자권한.모두허용; this.userInfo["상품정보"] = 사용자권한.모두허용; this.userInfo["세금계산서관리"] = 사용자권한.모두허용; this.userInfo["양식정보"] = 사용자권한.모두허용; this.userInfo["에프터서비스관리"] = 사용자권한.모두허용; this.userInfo["인사관리"] = 사용자권한.모두허용; this.userInfo["일정관리"] = 사용자권한.모두허용; this.userInfo["재고관리"] = 사용자권한.모두허용; this.userInfo["판매관리"] = 사용자권한.모두허용; this.userInfo["표준관리"] = 사용자권한.모두허용; this.userInfo["회계관리"] = 사용자권한.모두허용; } else { object obj = new LogIn(id, password).GetData(); try { this.userInfo = (UserInfoProxyVO)obj; } catch (InvalidCastException) { throw new System.Exception("아이디가 존재하지 않거나 패스워드가 틀렸습니다"); } catch (System.Exception ex) { throw new System.Exception(string.Format("로그인을 실패하였습니다 ({0})", ex.Message)); } } //설정정보 가져오기 try { object obj = new SelectCommonSettings().GetData(); this.settingInfo = (CommonSettingProxyVO)obj; } catch (System.Exception) { } //자기 자신의 정보 가져오기 try { object obj = new SelectMyCompany().GetData(); this.myInfo = (MyCompanyProxyVO)obj; } catch (System.Exception) { } if (this.myInfo == null) { this.myInfo = new MyCompanyProxyVO(); } if (this.settingInfo == null) { this.settingInfo = new CommonSettingProxyVO(); } }
public Insert(CommonSettingProxyVO CommonSettinginfo) : base("기본설정 입력", Hitpan5ClientLibrary.SQLDataServiceModel) { this.CommonSettinginfo = CommonSettinginfo; this.dbModel = Hitpan5ClientLibrary.SQLDataServiceModel; }
public abCMD(string work, SQLDataServiceModel dataModel) { this.work = work; this.loger = new Loger(dataModel); }
public abSelect(string work, SQLDataServiceModel dataModel) { this.work = work; this.dataModel = dataModel; this.loger = new Loger(this.dataModel); }