Пример #1
0
        public void TestMethod1()
        {
            string roof_type    = "1";
            double house_lenght = 5;
            double house_width  = 5;
            double degree       = 5;
            double cover        = 1;
            string profnastil   = "1";
            string barrier      = "50";
            string insulation   = "800";
            Calс   calс         = new Calс();
            string text         = calс.Сalculation(roof_type, house_lenght, house_width, degree, cover, profnastil, barrier, insulation);

            Assert.AreEqual(text, "1");
        }
Пример #2
0
        public ViewResult PostEntry(string roof_type, double house_length, double house_width, double degree, double cover, string profnastil, string barrier, string insulation)
        {
            Calс   calс = new Calс();
            string text = calс.Сalculation(roof_type, house_length, house_width, degree, cover, profnastil, barrier, insulation);

            switch (text)
            {
            case "1":
                ViewBag.Skat_width          = calс.skat_width;
                ViewBag.Profnastil_list_row = calс.profnastil_list_row;
                ViewBag.Calc_row_obresetka  = calс.calc_row_obresetka;
                ViewBag.Calc_obresetka      = calс.calc_obresetka;
                ViewBag.Calc_cost_obresetka = calс.calc_cost_obresetka;
                ViewBag.Calc_barrier        = calс.calc_barrier;
                ViewBag.Calc_insulation     = calс.calc_insulation;
                ViewBag.Cost_profnastil     = calс.cost_profnastil;
                ViewBag.Total_cost          = calс.total_cost;

                return(View("~/Views/Home/PostEntry1.cshtml"));

            case "2":
                ViewBag.Skat_width          = calс.skat_width;
                ViewBag.Profnastil_list_row = calс.profnastil_list_row;
                ViewBag.Calc_row_obresetka  = calс.calc_row_obresetka;
                ViewBag.Calc_obresetka      = calс.calc_obresetka;
                ViewBag.Calc_cost_obresetka = calс.calc_cost_obresetka;
                ViewBag.Calc_barrier        = calс.calc_barrier;
                ViewBag.Calc_insulation     = calс.calc_insulation;
                ViewBag.Cost_profnastil     = calс.cost_profnastil;
                ViewBag.Total_cost          = calс.total_cost;

                return(View("~/Views/Home/PostEntry2.cshtml"));

            case "3":
                ViewBag.Skat_width          = calс.skat_width;
                ViewBag.Profnastil_list_row = calс.profnastil_list_row;
                ViewBag.Calc_row_obresetka  = calс.calc_row_obresetka;
                ViewBag.Calc_obresetka      = calс.calc_obresetka;
                ViewBag.Calc_cost_obresetka = calс.calc_cost_obresetka;
                ViewBag.Calc_barrier        = calс.calc_barrier;
                ViewBag.Calc_insulation     = calс.calc_insulation;
                ViewBag.Cost_profnastil     = calс.cost_profnastil;
                ViewBag.Total_cost          = calс.total_cost;

                return(View("~/Views/Home/PostEntry3.cshtml"));

            case "4":
                ViewBag.Skat_width          = calс.skat_width;
                ViewBag.Profnastil_list_row = calс.profnastil_list_row;
                ViewBag.Calc_row_obresetka  = calс.calc_row_obresetka;
                ViewBag.Calc_obresetka      = calс.calc_obresetka;
                ViewBag.Calc_cost_obresetka = calс.calc_cost_obresetka;
                ViewBag.Calc_barrier        = calс.calc_barrier;
                ViewBag.Calc_insulation     = calс.calc_insulation;
                ViewBag.Cost_profnastil     = calс.cost_profnastil;
                ViewBag.Total_cost          = calс.total_cost;

                return(View("~/Views/Home/PostEntry4.cshtml"));
            }
            return(View("~/Views/Home/Index.cshtml"));
        }