Пример #1
0
        public void Display_Update_Supporters_Count()
        {
            IEnumerable<UpdateSupport> updtsprt = new List<UpdateSupport> {

            new UpdateSupport { UpdateSupportId =1, UpdateId = 1,UserId =  "402bd590-fdc7-49ad-9728-40efbfe512ec"},
            new UpdateSupport { UpdateSupportId =1, UpdateId = 1,UserId =  "402bd590-fdc7-49ad-9728-40efbfe512ed"},
            new UpdateSupport { UpdateSupportId =1, UpdateId = 1,UserId =  "402bd590-fdc7-49ad-9728-40efbfe512ef"},

              }.AsEnumerable();

            updateSupportRepository.Setup(x => x.GetMany(It.IsAny<Expression<Func<UpdateSupport, bool>>>())).Returns(updtsprt);
            GoalController controller = new GoalController(goalService, metricService, focusService, supportService, updateService, commentService, userService, securityTokenService, supportInvitationService, goalStatusService, commentUserService, updateSupportService);
            JsonResult count = controller.DisplayUpdateSupportCount(1) as JsonResult;
            Assert.IsNotNull(count);
            Assert.AreEqual(3, count.Data);
        }