Пример #1
0
        public void GetById_GivesActivity()
        {
            int activityId = 1;

            _activityRepository.Setup(a => a.GetById(activityId)).Returns(_dummyDBContext.Activity1);

            ActionResult <Activity> actionResult = _controller.GetById(activityId);
            var      response = actionResult?.Result as OkObjectResult;
            Activity activityThatCameBackFromResponse = response?.Value as Activity;

            Assert.Equal("Testatelier", activityThatCameBackFromResponse.Name);
        }