示例#1
0
        public BadgerTestEditorTests()
        {
            _view = Substitute.For <ITestEditorView>();
            _view.AddTreeNode(Arg.Any <string>()).Returns(new TreeNode());
            _view.When(v => v.ShowDialog()).Do(x => _view.OnFormLoad += Raise.EventWith(null, EventArgs.Empty));
            _fileService = Substitute.For <IFileService>();
            _messageBox  = Substitute.For <IMessageBoxService>();
            _fileBrowser = Substitute.For <IFileBrowser>();

            _fileService.GetLines(Arg.Any <string>()).Returns(new List <string>()
            {
                "Line1", "Line2"
            });
            _presenter = new BadgerTestEditorPresenter(_view, _fileService, _messageBox, _fileBrowser);
        }
示例#2
0
 public BadgerTestEditorPresenter(ITestEditorView view,
                                  IFileService fileService,
                                  IMessageBoxService messageBox,
                                  IFileBrowser fileBrowser)
 {
     _view                        = view;
     _fileService                 = fileService;
     _messageBox                  = messageBox;
     _fileBrowser                 = fileBrowser;
     _view.OnFormLoad            += ViewOnFormLoad;
     _view.OnFormIsClosing       += ViewOnFormClosing;
     _view.OnCloseClick          += ViewOnCloseClick;
     _view.OnSaveClick           += ViewOnSaveClick;
     _view.OnSaveAsClick         += ViewOnSaveAsClick;
     _view.OnTestCaseTextChanged += ViewOnTestCaseChanged;
     _view.OnTreeNodeSelect      += ViewOnTreeNodeSelect;
     _view.OnAddClick            += ViewOnAddClicked;
 }