Esempio n. 1
0
        public void GetDataByProjectIdTest()
        {
            _repository
            .Setup(it => it.GetDataByProjectId(It.IsAny <Int32>()))
            .Returns <Int32>((projectId) =>
            {
                return(_repositoryList.Where(x => x.ProjectId == projectId).ToList());
            });

            var result = _target.GetDataByProjectId(projectIdValue).ToList();

            Assert.AreEqual(_repositoryList.Where(x => x.ProjectId == projectIdValue).ToList().Count, result.Count);
        }