public void GetById_Should_Return_Count_Of_Items() { var result = _logController.Get(); var response = (result as OkObjectResult).Value as CustomApiResponse; var expect = _repository.Get <Log>().ToArray(); Assert.IsTrue((result as OkObjectResult).StatusCode == 200); Assert.IsTrue((response.Result as Log[]).Length > 0); Assert.AreEqual(expect.Length, (response.Result as Log[]).Length); }