public void SavesTheUpload() { // Arrange var uploadTracker = new Mock <IUploadTracker>(); var uploadController = new UploadController(uploadTracker.Object) { Request = new HttpRequestMessage() }; // Act var upload = new RawUpload(); uploadController.Get(upload); // Assert uploadTracker.Verify(tracker => tracker.Save(upload)); }
public HttpResponseMessage Get([FromUri(BinderType = typeof(RawUploadModelBinder))] RawUpload rawUpload) { _uploadTracker.Save(rawUpload); return(Request.CreateResponse(HttpStatusCode.OK)); }