示例#1
0
        private static async Task RunGeneralTests()
        {
            var tests = new GeneralTests();
            await tests.Should_detect_OAS_type_from_json_file();

            await tests.Should_detect_OAS_type_from_yaml_file();

            await tests.Should_detect_RAML_type_from_file_contents();

            await tests.Should_detect_RAML_08();

            await tests.Should_accept_file_without_prefix();

            await tests.Should_accept_file_with_prefix();

            await tests.Should_throw_if_file_not_exists();
        }
示例#2
0
        public static void RunMainCode(Patient patient, Course course, PlanSetup plan)
        {
            // Launch the class that uses a direct DB query to gather info that API does not have access to. Inside this class the code will be the same between the standalone and script versions.
            DBQuery.RunDBQuery(patient, course, plan);

            // Launch the class that does general plan checks from API retrieved data. Inside this class the code will be the same between the standalone and script versions.
            GeneralTests.RunGeneralTests(patient, course, plan);


            // Check message to see if anything was found and update the msg property.
            string msg = SomeProperties.MsgString;

            if (msg == "")
            {
                SomeProperties.MsgString = "No issues found!";
            }
            else
            {
                SomeProperties.MsgString = "Some issues found!" + SomeProperties.MsgString;
            }

            //Log useage and results to mapped, shared drive
            if (SomeProperties.LoggingFlag == true)
            {
                msg = SomeProperties.MsgString.Replace("\n\n", " - ");
                var    user = SomeProperties.User;
                string log  = DateTime.Now + " - " + user + " - " + patient.Id + " - " + course.Id + " - " + plan.Id + " - " + SomeProperties.ScriptVersion + " - " + msg;
                string path = SomeProperties.LogPath;

                using (StreamWriter sw = File.AppendText(path))
                {
                    sw.WriteLine(log);
                }
            }

            // Display the main window with the results
            MainWindow mw = new MainWindow();

            mw.Show();
        }