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()) { myInfoCommand.preMyInfo = null; listener.Insert(myInfo); LastCall.Return(true); } myInfoCommand.execute(); mocks.Verify(listener); }
public void Undo_Test_기존에_입력된_내용이_있을때() { MockRepository mocks = new MockRepository(); ICommandListener listener = mocks.DynamicMock <myInfoController>(); myInfo mi = mocks.Stub <myInfo>(); MyInfoInsertUpdateCommand myIUCMD = new MyInfoInsertUpdateCommand(mi, listener); myIUCMD.preMyInfo = new myInfo(); using (mocks.Record()) { listener.Delete(mi); listener.Insert(myIUCMD.preMyInfo); LastCall.Return(true); } myIUCMD.Undo(); mocks.Verify(listener); }
public void execute_Test_정상적인_값을_파라미터로_주고_정상적으로_입력되는지() { MockRepository mocks = new MockRepository(); UserInfo data = mocks.Stub <UserInfo>(); ICommandListener mockCommandListener = mocks.DynamicMock <UserAuthController>(); MakeAuth MakeUserCommand = new MakeAuth(data, mockCommandListener); using (mocks.Record()) { data.id = "id"; data.password = "******"; data.userAuth = "userAuth"; data.userType = 사용자등급.일반사용자; mockCommandListener.Insert(data); LastCall.Return(true); } MakeUserCommand.execute(); mocks.Verify(mockCommandListener); }