public void CommentClick() { _routerMock.Setup(f => f.ToComments()); var presenter = new PresenterPostSocial(_viewMock.Object, _interactorMock.Object, _routerMock.Object, _localeStrings.Object, _stylesHolderMock.Object); presenter.CommentClick(); _routerMock.Verify(f => f.ToComments(), Times.Once); }
public void CheckLikedState_Errors(EPostSocialResponseStatus responseState) { _viewMock.Setup(f => f.ShowAlert(It.IsAny <string>(), It.IsAny <string>())); _localeStrings.SetupGet(f => f.LikeError).Returns(It.IsAny <string>()); var presenter = new PresenterPostSocial(_viewMock.Object, _interactorMock.Object, _routerMock.Object, _localeStrings.Object, _stylesHolderMock.Object); presenter.CheckLikedState(responseState); _viewMock.Verify(f => f.ShowAlert(It.IsAny <string>(), It.IsAny <string>()), Times.Once); }
public void LikeClick() { _viewMock.Setup(f => f.SetLikeDrawable(It.IsAny <IButtonTheme>())); _interactorMock.Setup(f => f.LikeClick()); _stylesHolderMock.SetupGet(f => f.LikeTheme).Returns(It.IsAny <IButtonTheme>()); var presenter = new PresenterPostSocial(_viewMock.Object, _interactorMock.Object, _routerMock.Object, _localeStrings.Object, _stylesHolderMock.Object); presenter.LikeClick(); _interactorMock.Verify(f => f.LikeClick(), Times.Once); }
public void CheckLikedState_Success(EPostSocialResponseStatus responseState) { _viewMock.Setup(f => f.SetLikeText(It.IsAny <string>())); _localeStrings.SetupGet(f => f.Like).Returns(It.IsAny <string>()); _interactorMock.Setup(f => f.GetLikeCount()).Returns(It.IsAny <int>()); _interactorMock.Setup(f => f.GetIsLiked()).Returns(true); _stylesHolderMock.SetupGet(f => f.LikeTheme).Returns(It.IsAny <IButtonTheme>()); _viewMock.Setup(f => f.SetLikeDrawable(It.IsAny <IButtonTheme>())); var presenter = new PresenterPostSocial(_viewMock.Object, _interactorMock.Object, _routerMock.Object, _localeStrings.Object, _stylesHolderMock.Object); presenter.CheckLikedState(responseState); _viewMock.Verify(f => f.SetLikeText(It.IsAny <string>()), Times.Once); _interactorMock.Verify(f => f.GetIsLiked(), Times.Once); _stylesHolderMock.VerifyGet(f => f.LikeTheme, Times.Once); _viewMock.Verify(f => f.SetLikeDrawable(It.IsAny <IButtonTheme>()), Times.Once); }
public void SetSocialIsNotLiked() { _viewMock.Setup(f => f.SetLikeDrawable(It.IsAny <IButtonTheme>())); _viewMock.Setup(f => f.SetLikeText(It.IsAny <string>())); _viewMock.Setup(f => f.SetCommentText(It.IsAny <string>())); _localeStrings.SetupGet(f => f.Like).Returns(It.IsAny <string>()); _localeStrings.SetupGet(f => f.Comments).Returns(It.IsAny <string>()); _stylesHolderMock.SetupGet(f => f.NotLikeTheme).Returns(It.IsAny <IButtonTheme>()); var presenter = new PresenterPostSocial(_viewMock.Object, _interactorMock.Object, _routerMock.Object, _localeStrings.Object, _stylesHolderMock.Object); presenter.SetSocial(new DataModelPost(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>(), It.IsAny <float>(), It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>(), It.IsAny <int>(), It.IsAny <int>(), false)); _stylesHolderMock.VerifyGet(f => f.NotLikeTheme, Times.Once); _viewMock.Verify(f => f.SetLikeDrawable(It.IsAny <IButtonTheme>()), Times.Once); _viewMock.Verify(f => f.SetLikeText(It.IsAny <string>()), Times.Once); _viewMock.Verify(f => f.SetCommentText(It.IsAny <string>()), Times.Once); }
public PresenterPost(IViewPost view, IInteractorPost interactor, IRouterPost router, PostOtherThemeStrings otherThemeStrings, IPostHeaderStylesHolder headerStylesHolder, IPostSocialStylesHolder socialStylesHolder, IPostBodyStylesHolder bodyStylesHolder, IPost postLocale, bool isPostDetailed) { _view = view; _router = router; _interactor = interactor; _postLocale = postLocale; _isPostDetailed = isPostDetailed; _otherThemeStrings = otherThemeStrings; IPresenterPostHeader presenterPostHeader = new PresenterPostHeader(view.ViewPostHeader, interactor.InteractorPostHeader, router, DataService.RepositoryController.RepositoryPost.LangPost, headerStylesHolder); IPresenterPostBody presenterPostBody = new PresenterPostBody(view.ViewPostBody, interactor.InteractorPostBody, router, bodyStylesHolder, isPostDetailed); IPresenterPostSocial presenterPostSocial = new PresenterPostSocial(view.ViewPostSocial, interactor.InteractorPostSocial, router, DataService.RepositoryController.RepositoryPost.LangPost, socialStylesHolder); interactor.InteractorPostBody.Presenter = presenterPostBody; interactor.InteractorPostHeader.Presenter = presenterPostHeader; interactor.InteractorPostSocial.Presenter = presenterPostSocial; _view.SetConfig(); presenterPostHeader.SetConfig(); presenterPostSocial.SetConfig(); }
public void SetLocale() { var presenter = new PresenterPostSocial(_viewMock.Object, _interactorMock.Object, _routerMock.Object, _localeStrings.Object, _stylesHolderMock.Object); _viewMock.Verify(f => f.SetShareText(It.IsAny <string>()), Times.Once); }