public void GetAllContent_SendRequest_ReceiveListOfAllContent() { //Arrange-->Setup() //Act contentRepo.Setup(cr => cr.GetAllContent()).Returns(listContent); var res = (contentController.GetAllContent() as OkObjectResult).Value as IEnumerable <Content>; //Assert Assert.IsNotNull(res); Assert.AreEqual(res.Count(), 2); Assert.AreEqual(res.Select(x => x.ContentText).Skip(1).First(), "Content2"); //picking the second item from the rerutned Contentlist }