示例#1
0
        public void ViewProductEdit_ShouldCallServiceGetById(int id)
        {
            var mockView    = new Mock <ITourneyView>();
            var mockFactory = new Mock <IViewModelFactory>();
            var mockService = new Mock <ITourneyService>();

            var presenter =
                new TourneyPresenter(mockView.Object, mockService.Object, mockFactory.Object);

            var model = new TourneyDetailsViewModel()
            {
                Id = id
            };
            var args = new EditTourneyEventArgs(model);

            mockView.Raise(x => x.EditTourney += null, args);

            mockService.Verify(s => s.GetById(id), Times.Once);
        }
 public EditTourneyEventArgs(TourneyDetailsViewModel model)
 {
     this.Model = model;
 }