public void Calcpr( double firstElement, double secondElement, double expected) { var calculator = new Fractionation(); var actualResult = calculator.Calculate(firstElement, secondElement); Assert.AreEqual(expected, actualResult, 0.01); }
//private DatabaseManager databaseManager; public Checklist(Patient patient, Course course, PlanSetup planSetup, ChecklistType checklistType, string userId, string profession) { //planSetup.Beams = planSetup.Beams.OrderByDescending(x => x.Id); this.patient = patient; this.course = course; this.planSetup = planSetup; this.checklistType = checklistType; this.userId = userId; this.profession = profession; databaseManager = new DatabaseManager(Settings.RESULT_SERVER, Settings.RESULT_USERNAME, Settings.RESULT_PASSWORD); try { // Uncommented since it leads to timeout //databaseManager.CreateDatabase(); } catch { } try { structureSet = planSetup.StructureSet; if (structureSet != null) { image = planSetup.StructureSet.Image; } try { fractionation = planSetup.UniqueFractionation; } catch { } treatmentUnitManufacturer = GetTreatmentUnitManufacturer(); treatmentSide = GetTreatmentSide(planSetup); numberOfTreatmentBeams = GetNumberOfTreatmentBeams(); numberOfBeams = GetNumberOfBeams(); } catch (Exception exception) { System.Windows.Forms.MessageBox.Show(exception.Message, "Error", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error); } try { AriaInterface.Connect(); AriaInterface.GetPlanSetupSer(patient.Id, course.Id, planSetup.Id, out patientSer, out courseSer, out planSetupSer); AriaInterface.Disconnect(); } catch (Exception exception) { System.Windows.Forms.MessageBox.Show(exception.Message, "ARIA Interface Error", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error); } }