public void GetElementViaIdSuccess() { //Arrange Todo.TodoElements.Clear(); var testTodoData = new ToDoElement(1, "test", "testContent"); var testTodoData2 = new ToDoElement(2, "test1", "testContent"); Todo.TodoElements.Add(testTodoData); Todo.TodoElements.Add(testTodoData2); var expectedObject = Json(testTodoData); //Act var receivedData = _controller.GetTodoViaId(1); //Assert Assert.Equal(expectedObject.Value, receivedData.Value); }