Moq, SetupGet, Mocking a property
ColumnNames is a property of type List<String> so when you are setting up you need to pass a List<String> in the Returns call as an argument (or a func which return a List<String>) But with this line you are trying to return just a string input.SetupGet(x => x.ColumnNames).Returns(temp[0]); which is causing the exception. Change it … Read more