Beispiel #1
0
 protected Tag()
 {
     this.presenter = new TagPresenter(this);
 }
        public void TagPresenterInitiliazingShouldReturnTwoPosts()
        {
            // Arrange
            List<PostViewModel> posts = new List<PostViewModel>();
            var tagViewMock = new Mock<ITagView>();
            tagViewMock.SetupSet(t => t.Posts = It.IsAny<List<PostViewModel>>())
                .Callback<List<PostViewModel>>((list) => posts = list);

            var fakeTagPresenter = new TagPresenter(tagViewMock.Object, this.mocksContainer.DataMock.Object);

            // Act
            fakeTagPresenter.Initialize("TestTag1");

            // Assert
            Assert.AreEqual(2, posts.Count);
        }