public void UploadTest() { Mock <IFormFile> fileMock = createMock("Nomination form.pdf", "pdf"); var result = docController.OnPostUploadAsync(fileMock.Object).Result; Assert.True(((Microsoft.AspNetCore.Mvc.ObjectResult)result).Value.ToString() == "Uploaded"); }