public async Task TaskKeyAndSingleFileModel() { var guidelineApi = Resolver.GetService <IGuidelineApi>(); var model = new SingleFileModel { File = TestHelper.GetFormFile("file") }; await guidelineApi.TaskKeyAndSingleFileModel(_someKey, model); Assert.True(true); }
public async Task TaskSingleFileModel() { var guidelineApi = Resolver.GetService <IGuidelineApi>(); var model = new SingleFileModel { File = TestHelper.GetFormFile("file", "SampleĞüişçWord.docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document") }; await guidelineApi.TaskSingleFileModel(model); Assert.True(true); }
public async Task TaskSingleFileModel(SingleFileModel model) { await Task.CompletedTask; var name = model.File.Name; var fileName = model.File.FileName; var length = model.File.Length; using (var ms = new MemoryStream()) { model.File.CopyTo(ms); System.IO.File.WriteAllBytes(Path.Combine(_hostingEnvironment.ContentRootPath, fileName), ms.ToArray()); } _logger.LogWarning(JsonConvert.SerializeObject(new { name, fileName, length })); }
public void ProxyModelMetadataInfoForSingleFile() { var formFile = TestHelper.GetFormFile("file"); var length = formFile.Length; var model = new SingleFileModel { File = formFile }; var contentResult = GetResolvedContentResult(model); var files = contentResult.Files; var dictionary = contentResult.Dictionary; Assert.True(1 == files.Count); Assert.True(0 == dictionary.Count); Assert.Equal("some_text_file.txt", files["File"].FileName); Assert.Equal(length, files["File"].Length); }
public Task TaskKeySingleFileAndBarModel(string key, SingleFileModel model, Bar bar) { throw new NotImplementedException(); }
public Task TaskKeyAndSingleFileModel(string key, SingleFileModel model) { throw new NotImplementedException(); }