public void SetBodySmallTextTest() { _viewMock.Setup(f => f.SetContent("content", It.IsAny <ITextViewTheme>())); _viewMock.Setup(f => f.SetImage("")); _interactorMock.SetupGet(f => f.PostId).Returns(It.IsAny <string>()); _interactorMock.SetupGet(f => f.IsPostDetailed).Returns(It.IsAny <bool>()); _interactorMock.Setup(f => f.GetRepository()).Returns(new SocialTrading.Service.Repositories.Repository(new RepositoryUserAuth(), new RepositoryUserSettings())); _stylesHolderMock.SetupGet(f => f.ContentTheme).Returns(It.IsAny <ITextViewTheme>()); var presenter = new PresenterPostBody(_viewMock.Object, _interactorMock.Object, _routerMock.Object, _stylesHolderMock.Object, false); presenter.SetBody(new DataModelPost(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>(), It.IsAny <float>(), It.IsAny <string>(), "", "content", It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>(), It.IsAny <string>(), It.IsAny <int>(), It.IsAny <int>(), It.IsAny <bool>()) { CachedImage = "" }); _viewMock.Verify(f => f.SetContent("content", It.IsAny <ITextViewTheme>()), Times.Once); _viewMock.Verify(f => f.SetImage(""), Times.Once); _stylesHolderMock.VerifyGet(f => f.ContentTheme, Times.Once); }
public void ReadMoreClickTest() { _routerMock.Setup(f => f.ToDetailedPost(It.IsAny <string>())); _interactorMock.SetupGet(f => f.PostId).Returns(It.IsAny <string>()); var presenter = new PresenterPostBody(_viewMock.Object, _interactorMock.Object, _routerMock.Object, _stylesHolderMock.Object, false); presenter.ReadMoreClick(); _routerMock.Verify(f => f.ToDetailedPost(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(); }