public TestGenerationPageViewModel() { this.service = new TestGenerationService(); this.AllThemes = new ObservableCollection <ThemeDTO>(this.service.GetThemesBySubject(Authenticator.CurrentUser.Subject.Id)); this.allQuestions = this.service.GetQuestionsBySubject(Authenticator.CurrentUser.Subject.Id); this.ShowTestQuestions = true; this.NewQuestion = new QuestionDTO(); }
internal async Task CreateUnitTestAsync(IList <ProjectItemSummary> selectedFiles, bool addToProject = true) { var generationService = new TestGenerationService(); var createdTestPaths = new List <string>(); foreach (ProjectItemSummary selectedFile in selectedFiles) { string generatedTestPath = await generationService.GenerateUnitTestFileAsync( selectedFile, this.SelectedProject.Project, this.SelectedTestFramework, this.SelectedMockFramework); createdTestPaths.Add(generatedTestPath); } if (addToProject) { bool focusSet = false; foreach (string createdTestPath in createdTestPaths) { // Add the file to project ProjectItem testItem = this.SelectedProject.Project.ProjectItems.AddFromFile(createdTestPath); Window testWindow = testItem.Open(EnvDTE.Constants.vsViewKindCode); testItem.ExpandView(); testWindow.Visible = true; if (!focusSet) { testWindow.SetFocus(); focusSet = true; } } StaticBoilerplateSettings.SaveSelectedTestProject(this.dte.Solution.FileName, this.SelectedProject.Project.FileName); } this.View?.Close(); }
public void ReportMissingRewriter(string testPrefix, MachineInstruction instr, string mnemonic, EndianImageReader rdr, string message, Func <byte[], string> hexizer) { var test = TestGenerationService.GenerateRewriterUnitTest(testPrefix, instr, mnemonic, rdr, message, hexizer ?? Hexizer); Console.WriteLine(test); }
public void ReportMissingDecoder(string testPrefix, Address addrStart, EndianImageReader rdr, string message, Func <byte[], string> hexizer) { var test = TestGenerationService.GenerateDecoderUnitTest(testPrefix, addrStart, rdr, message, hexizer ?? Hexizer); Console.WriteLine(test); }
public void ReportMissingRewriter(string testPrefix, MachineInstruction instr, EndianImageReader rdr, string message) { var test = TestGenerationService.GenerateRewriterUnitTest(testPrefix, instr, rdr, message); Console.WriteLine(test); }