public void ResetDatabase() { using (var session = TckHooks.CreateSelfManagedSession()) { session.Run("MATCH (n) DETACH DELETE n").Consume(); } }
public void GivenInit(string statement) { using (var session = TckHooks.CreateSelfManagedSession()) { session.Run(statement).Consume(); } }
public void WhenIRunANonValidCypherStatement() { using (var session = TckHooks.CreateSelfManagedSession()) { var ex = Xunit.Record.Exception(() => session.Run("Invalid Cypher")); ex.Should().BeOfType <ClientException>(); ex.Message.Should().StartWith("Invalid input"); } }
public void WhenIStartANewTransactionWithTheSameSessionBeforeClosingThePrevious() { using (var session = TckHooks.CreateSelfManagedSession()) using (var tx = session.BeginTransaction()) { var ex = Xunit.Record.Exception(() => session.BeginTransaction()); ex.Should().BeOfType <ClientException>(); ex.Message.Should().StartWith("Please close the currently open transaction object"); } }
public void WhenRunAQueryWithThatSameSessionWithoutClosingTheTransactionFirst() { using (var session = TckHooks.CreateSelfManagedSession()) using (var tx = session.BeginTransaction()) { var ex = Xunit.Record.Exception(() => session.Run("RETURN 1")); ex.Should().BeOfType <ClientException>(); ex.Message.Should().StartWith("Please close the currently open transaction object"); } }
public void GivenValue1IsSingleValueResultOf(string key, string statement) { using (var session = TckHooks.CreateSelfManagedSession()) { var statementResult = session.Run(statement); var value = statementResult.Single()[0]; if (!ScenarioContext.Current.ContainsKey(ValueListkey)) { ScenarioContext.Current.Set(new List <object>(), ValueListkey); } var values = ScenarioContext.Current.Get <IList <object> >(ValueListkey); values.Add(value); } }
public void ResetDatabase() { using (var session = TckHooks.CreateSelfManagedSession()) { session.Run("MATCH (n) DETACH DELETE n").Consume(); var dropConstraints = session.Run("CALL db.constraints() YIELD description RETURN 'DROP ' + description"); foreach (var drop in dropConstraints) { session.Run(drop[0].ToString()).Consume(); } var dropIndices = session.Run("CALL db.indexes() YIELD description RETURN 'DROP ' + description"); foreach (var drop in dropIndices) { session.Run(drop[0].ToString()).Consume(); } } }