public static NetzSummarischDetail GetNetzSummarischDetail(this NHibernateSpecflowScope scope, string belastungskategorie, Mandant mandant, ErfassungsPeriod erfassungsPeriod) { return(scope.Session.Query <NetzSummarischDetail>() .Single(ns => ns.Belastungskategorie.Typ == belastungskategorie && ns.NetzSummarisch.Mandant == mandant && ns.NetzSummarisch.ErfassungsPeriod == erfassungsPeriod)); }
public void BeforeScenario() { if (ScenarioContext.Current.ScenarioInfo.Tags.Contains("Manuell")) { return; } //Initialize Db if (File.Exists("emsg.sdf")) { File.Delete("emsg.sdf"); } var dbHandlerUtils = new DbHandlerUtils(NHibernateDb.ConfigurationProvider.Value.Configuration); dbHandlerUtils.ReCreateDbSchema(); using (var nHScope = new NHibernateSpecflowScope()) { dbHandlerUtils.GenerateStammDaten(nHScope.Session); var transactionScopeProvider = new TransactionScopeProvider(new TestHttpRequestService(), new TransactionScopeFactory(NHibernateDb.ConfigurationProvider.Value)); transactionScopeProvider.SetCurrentTransactionScope(nHScope.Scope); } var browserDriver = new BrowserDriver(); browserDriver.InvokeGetAction <TestingController, ActionResult>((c, r) => c.StartNewSession(), (ActionResult)null); }
public static Mandant GetCurrentMandant(this NHibernateSpecflowScope scope) { var dbCtx = new ApplicationDbContext(scope.Session.Connection.ConnectionString); var currentUserMandanten = dbCtx.MandantRoles.Where(m => m.User.UserName == "test") .Select(a => a.MandantName).Distinct().Single(); return(scope.Session.Query <Mandant>().Single(c => c.MandantName == currentUserMandanten)); }
public static Belastungskategorie GetBelastungskategorie(this NHibernateSpecflowScope scope, string belastungskategorieTyp) { return(scope.Session.Query <Belastungskategorie>().Single(bk => bk.Typ == belastungskategorieTyp)); }
public static List <ErfassungsPeriod> GetClosedErfassungsperiods(this NHibernateSpecflowScope scope, string mandant) { return(scope.Session.Query <ErfassungsPeriod>().Where(ep => ep.Mandant.MandantName == mandant && ep.IsClosed).ToList()); }
public static ErfassungsPeriod GetCurrentErfassungsperiod(this NHibernateSpecflowScope scope, Mandant mandant) { return(scope.Session.Query <ErfassungsPeriod>().Single(ep => ep.Mandant == mandant && !ep.IsClosed)); }
public static Mandant GetMandant(this NHibernateSpecflowScope scope, string mandant) { return(scope.Session.Query <Mandant>().Single(m => m.MandantName == mandant)); }