Amount of files in Moq request

Asked

Viewed 15 times

1

The SetupGet to for the form (Form) of the request works, however the Count doesn’t work. How to solve for the Count return the desired value?

var httpContextMock = new Mock<HttpContextBase>();
var request = new Mock<HttpRequestBase>();

httpContextMock.SetupGet(x => x.Request).Returns(request.Object);            
httpContextMock.SetupGet(x => x.Request.Form).Returns(form);
httpContextMock.SetupGet(x => x.Request.Files.Count).Returns(2);
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.