Exemplo n.º 1
0
        public IFigure Combine()
        {
            if (this.Type == null)
            {
                try
                {
                    switch (mode)
                    {
                    case FigureMode.Reference:
                        combineDynamicType(new FigureCompilerReference(this, fieldRubrics, propertyRubrics));
                        break;

                    case FigureMode.ValueType:
                        combineDynamicType(new FigureCompilerValueType(this, fieldRubrics, propertyRubrics));
                        break;

                    case FigureMode.Derived:
                        combineDerivedType(new FigureCompilerDerivedType(this, fieldRubrics, propertyRubrics));
                        break;

                    default:
                        break;
                    }

                    Rubrics.Update();
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
            return(newFigure());
        }
Exemplo n.º 2
0
        private void cmdJUnitUpload_Click(object sender, System.EventArgs e)
        {
            //Import tester data
            AutoEvaluation  eval;
            Evaluations     evalda = new Evaluations(Globals.CurrentIdentity);
            Rubrics         rubda  = new Rubrics(Globals.CurrentIdentity);
            IExternalSource esrc;

            if (fiJUnit.PostedFile.ContentLength == 0)
            {
                PageJUnitError("You must specify a tester suite to upload");
                return;
            }
            else
            {
                esrc = CreateSource(fiJUnit.PostedFile);
                eval = (AutoEvaluation) new Evaluations(Globals.CurrentIdentity).GetInfo(
                    Convert.ToInt32(lblEvalID.Text));
            }

            //Load files
            try {
                evalda.UpdateAuto(eval, esrc);
            } catch (CustomException er) {
                PageJUnitError(er.Message);
                return;
            }

            //Discover JUnit test
            double points = 0;
            int    time = 0, count = 0;

            try {
                new JUnitTool().Discover(eval, out points, out time, out count);
            } catch (CustomException er) {
                PageJUnitError(er.Message);
            }

            //Update points and time
            Rubric rub = rubda.GetInfo(GetCurrentID());

            eval.TimeLimit = time;
            rub.Points     = points;
            try {
                evalda.UpdateAuto(eval, new EmptySource());
                rubda.Update(rub);
                PageJUnitError("Upload successful!");
            } catch (CustomException er) {
                PageJUnitError(er.Message);
            }

            UpdateRightSide();
        }