コード例 #1
0
        private static HomeController NyHomeControllerMedSession()
        {
            var bllflyplass   = new BLLFlyplass(new DBFlyplassStub());
            var bllflygning   = new BLLFlygning(new DBFlygningStub(), new DBFlyplassStub(), new DBRuteStub(), new DBFlyStub());
            var bllbestilling = new BLLBestilling(new DBBestillingStub(), new DBFlygningStub());
            var bllkunde      = new BLLKunde(new DBKundeStub(), new DBPostnummerStub());

            var sessionMock = new TestControllerBuilder();
            var controller  = new HomeController(bllflyplass, bllflygning, bllbestilling, bllkunde);

            sessionMock.InitializeController(controller);
            return(controller);
        }
コード例 #2
0
        private static AdminController NyAdminControllerMedSession(bool settErAdminTilTrue)
        {
            var bllfly        = new BLLFly(new DBFlyStub());
            var bllflyplass   = new BLLFlyplass(new DBFlyplassStub());
            var bllflygning   = new BLLFlygning(new DBFlygningStub(), new DBFlyplassStub(), new DBRuteStub(), new DBFlyStub());
            var bllbestilling = new BLLBestilling(new DBBestillingStub(), new DBFlygningStub());
            var bllkunde      = new BLLKunde(new DBKundeStub(), new DBPostnummerStub());
            var bllrute       = new BLLRute(new DBRuteStub());
            var bllendring    = new BLLEndring(new DBEndringStub());
            var blladmin      = new BLLAdminStub();

            var sessionMock = new TestControllerBuilder();
            var controller  = new AdminController(bllbestilling, bllfly, bllkunde, bllflyplass, bllflygning, bllrute, bllendring, blladmin);

            sessionMock.InitializeController(controller);
            if (settErAdminTilTrue)
            {
                controller.Session["admin"] = true;
            }

            return(controller);
        }
コード例 #3
0
 public HomeController(BLLFlyplass bllflyplassStub, BLLFlygning bllflygningStub, BLLBestilling bllbestillingStub, BLLKunde bllkundeStub)
 {
     this.bllflyplass   = bllflyplassStub;
     this.bllflygning   = bllflygningStub;
     this.bllbestilling = bllbestillingStub;
     this.bllkunde      = bllkundeStub;
 }