public async Task SetViewModelPropertiesForArticle_SetsTheRequiredViewModelProperties() { // Arrange var user = await CurrentUserContext.GetCurrentUserContext(); // Act _articleViewModel.SetViewModelPropertiesForArticle(_articleViewModel.Article, _articles.First(), _articleTags, user); // Assert _articleViewModel.Article.Author.Following.ShouldBeTrue(); _articleViewModel.Article.Favorited.ShouldBeTrue(); _articleViewModel.Article.TagList.ShouldNotBeEmpty(); }
public async Task SetViewModelProperties_ForEachArticle_SetsTheRequiredViewModelProperties() { // Arrange var authorToFollow = _articleViewModelList.Articles.FirstOrDefault(a => a.Author.Username == "joey.mckenzie"); authorToFollow.ShouldNotBeNull(); authorToFollow.Author.Following.ShouldBeFalse(); var user = await CurrentUserContext.GetCurrentUserContext(); // Act _articleViewModelList.SetViewModelProperties(_articles, user, _articleTags); // Assert authorToFollow.Author.Following.ShouldBeTrue(); authorToFollow.Favorited.ShouldBeTrue(); authorToFollow.TagList.ShouldNotBeEmpty(); }