Beispiel #1
0
        public void execute_기존에_입력된_정보가_존재하고_파라미터는_정상인_경우()
        {
            MockRepository            mocks         = new MockRepository();
            ICommandListener          listener      = mocks.DynamicMock <myInfoController>();
            myInfo                    myInfo        = mocks.Stub <myInfo>();
            MyInfoInsertUpdateCommand myInfoCommand = new MyInfoInsertUpdateCommand(myInfo, listener);

            using (mocks.Record())
            {
                listener.Select();
                myInfoCommand.preMyInfo = new myInfo();
                listener.Update(myInfo, null);
                LastCall.Return(true);
            }
            myInfoCommand.execute();
            mocks.Verify(listener);
        }
Beispiel #2
0
        public void execute_업데이트과정_정상적으로_거치는지_검증()
        {
            MockRepository mocks    = new MockRepository();
            UserInfo       stubData = mocks.Stub <UserInfo>();

            stubData.id       = "id";
            stubData.password = "******";
            ICommandListener mockListener = mocks.DynamicMock <UserAuthController>();
            UpdateUserInfo   uui          = new UpdateUserInfo(stubData, mockListener);

            using (mocks.Record())
            {
                mockListener.Select(stubData);
                mockListener.Update(stubData, stubData);
                LastCall.Return(true);
            }
            uui.execute();
            mocks.Verify(mockListener);
        }
Beispiel #3
0
        public void execute_Test_정상적으로입력_Return_True()
        {
            //Arrange
            MockRepository mocks     = new MockRepository();
            object         uInfo     = null;
            UserInfo       LoginInfo = mocks.Stub <UserInfo>();

            LoginInfo.id       = "id";
            LoginInfo.password = "******";
            ICommandListener mockCMDListener = mocks.DynamicMock <UserAuthController>();
            Login            login           = new Login(mockCMDListener, LoginInfo);

            using (mocks.Record())
            {
                mockCMDListener.Select(LoginInfo);
            }
            //Act
            bool isOK = login.execute(out uInfo);

            //Assert
            mocks.Verify(mockCMDListener);
        }