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); }
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); }
public HomeController(BLLFlyplass bllflyplassStub, BLLFlygning bllflygningStub, BLLBestilling bllbestillingStub, BLLKunde bllkundeStub) { this.bllflyplass = bllflyplassStub; this.bllflygning = bllflygningStub; this.bllbestilling = bllbestillingStub; this.bllkunde = bllkundeStub; }