public void Should_AddCorrectNews_WithHumanTaskHistoryAsParametr()
{
// arrange
User user = new User
{
UserName = "UserName",
Id = 2
};
HumanTaskHistory taskHistory = new HumanTaskHistory
{
Id = 1,
Action = "Create",
};
News news = new News
{
HumanTaskHistory = taskHistory,
HumanTaskHistoryId = taskHistory.Id,
Id = 1,
IsRead = false,
User = user,
UserId = user.Id
};
// act
this.newsProcessor.AddNews(taskHistory, user);
// assert
this.newsRepositoryMock.Verify(mock => mock.AddNews(It.Is<News>(x =>
x.HumanTaskHistoryId == taskHistory.Id
&& x.UserId == user.Id
&& x.User == user
&& x.HumanTaskHistory == taskHistory)),
Times.Once());
}