1234567891011121314151617181920212223242526272829303132 |
- using System;
- using System.IO;
- using Newtonsoft.Json;
- using QuestionSwapDoc;
- using QuestionSwapDoc.SwapQuestionModel;
- using Xunit;
- namespace YGNT.Exam.Tests.Question
- {
- public class ResolveTest
- {
- private string filePath = @"C:\Eaxm\aspnet-core\src\YGNT.Exam.Web.Host\wwwroot\Files\2021-三月-22\h05lhan0.p1h";
- [Fact]
- public void Resolve()
- {
- var fileName = Path.GetFileNameWithoutExtension(Path.GetRandomFileName());
- var resolvePath = Path.Combine(AppContext.BaseDirectory, "Question", "Resolve", fileName);
- var imgPath = Path.Combine(resolvePath, "img");
- var question = SwapQuestion.GetQue(filePath,
- resolvePath,
- imgPath,
- Path.GetRelativePath(AppContext.BaseDirectory, imgPath),
- new QueTypeString()
- {
- XuanZheStrings = new[] { "选择题" }
- });
- var json = JsonConvert.SerializeObject(question);
- }
- }
- }
|