Exemple #1
0
        static void UnitTest()
        {
            for (Int16 i = -1; i <= 101; i++)
            {
                Code1  codedata1  = new Code1(i);
                Code2  codedata2  = new Code2(i);
                Code3  codedata3  = new Code3(i);
                Code4  codedata4  = new Code4(i);
                Code5  codedata5  = new Code5(i);
                Code6  codedata6  = new Code6(i);
                Code7  codedata7  = new Code7(i);
                Code8  codedata8  = new Code8(i);
                Code9  codedata9  = new Code9(i);
                Code10 codedata10 = new Code10(i);

                if (codedata1.dataGrade != codedata2.dataGrade ||
                    codedata2.dataGrade != codedata3.dataGrade ||
                    codedata3.dataGrade != codedata4.dataGrade ||
                    codedata4.dataGrade != codedata5.dataGrade ||
                    codedata5.dataGrade != codedata6.dataGrade ||
                    codedata6.dataGrade != codedata7.dataGrade ||
                    codedata7.dataGrade != codedata8.dataGrade ||
                    codedata8.dataGrade != codedata9.dataGrade ||
                    codedata9.dataGrade != codedata10.dataGrade
                    )
                {
                    throw new Exception("Score: " + i + " is not equal Grade");
                }
            }
            Console.WriteLine("Score -1 to 101 checking Grade is Complated.");
        }
Exemple #2
0
        static void Main(string[] args)
        {
            if (args.Length > 0)
            {
                UnitTest();
            }
            else
            {
                Console.Write("Please input your grade here : ");
                int    dataPoint  = Convert.ToInt32(Console.ReadLine());
                Code1  codedata1  = new Code1(dataPoint);
                Code2  codedata2  = new Code2(dataPoint);
                Code3  codedata3  = new Code3(dataPoint);
                Code4  codedata4  = new Code4(dataPoint);
                Code5  codedata5  = new Code5(dataPoint);
                Code6  codedata6  = new Code6(dataPoint);
                Code7  codedata7  = new Code7(dataPoint);
                Code8  codedata8  = new Code8(dataPoint);
                Code9  codedata9  = new Code9(dataPoint);
                Code10 codedata10 = new Code10(dataPoint);

                Console.WriteLine("Code 01 Result :" + codedata1.dataGrade);
                Console.WriteLine("Code 02 Result :" + codedata2.dataGrade);
                Console.WriteLine("Code 03 Result :" + codedata3.dataGrade);
                Console.WriteLine("Code 04 Result :" + codedata4.dataGrade);
                Console.WriteLine("Code 05 Result :" + codedata5.dataGrade);
                Console.WriteLine("Code 06 Result :" + codedata6.dataGrade);
                Console.WriteLine("Code 07 Result :" + codedata7.dataGrade);
                Console.WriteLine("Code 08 Result :" + codedata8.dataGrade);
                Console.WriteLine("Code 09 Result :" + codedata9.dataGrade);
                Console.WriteLine("Code 10 Result :" + codedata10.dataGrade);
            }
        }
Exemple #3
0
        public ActionResult DeleteConfirmed(int id)
        {
            Code4 code4 = db.Codes4.Find(id);

            db.Codes4.Remove(code4);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #4
0
 public ActionResult Edit([Bind(Include = "Id,Name,FullName,Description")] Code4 code4)
 {
     if (ModelState.IsValid)
     {
         db.Entry(code4).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(code4));
 }
Exemple #5
0
        public ActionResult Create([Bind(Include = "Id,Name,FullName,Description")] Code4 code4)
        {
            if (ModelState.IsValid)
            {
                db.Codes4.Add(code4);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(code4));
        }
Exemple #6
0
        // GET: Code4/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Code4 code4 = db.Codes4.Find(id);

            if (code4 == null)
            {
                return(HttpNotFound());
            }
            return(View(code4));
        }
Exemple #7
0
 void Awake()
 {
     main = this;
 }