Number of files in the request with Moq

1

The SetupGet to for the form ( Form ) of the request works, however Count does not work. How do I resolve to 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);
    
asked by anonymous 08.08.2017 / 16:44

0 answers