public void CreateInstanceOfPresenter() { var mockedView = new Mock <IAllGamesView>(); var mockedGamesService = new Mock <IGamesService>(); var presenter = new AllGamesPresenter(mockedView.Object, mockedGamesService.Object); Assert.That(presenter, Is.InstanceOf <Presenter <IAllGamesView> >()); }
public void InitializeCorrectly_WhenParametersAreValid() { var mockedView = new Mock <IAllGamesView>(); var mockedGamesService = new Mock <IGamesService>(); var presenter = new AllGamesPresenter(mockedView.Object, mockedGamesService.Object); Assert.That(presenter, Is.Not.Null); }
public void CallGamessServiceGetAllMethod_WhenViewsEventIsRaised() { var mockedView = new Mock <IAllGamesView>(); var mockedModel = new Mock <AllGamesModel>(); mockedView.Setup(x => x.Model).Returns(mockedModel.Object); var mockedGamesService = new Mock <IGamesService>(); mockedGamesService.Setup(x => x.GetAll()).Returns(new List <GameDetails>()); var presenter = new AllGamesPresenter(mockedView.Object, mockedGamesService.Object); mockedView.Raise(x => x.GetGames += null, null, null); mockedGamesService.Verify(x => x.GetAll(), Times.Once); }