public void ConnectionTest() { using (STNDBContext context = new STNDBContext(new DbContextOptionsBuilder <STNDBContext>().UseNpgsql(this.connectionstring).Options)) { try { if (!(context.GetService <IDatabaseCreator>() as RelationalDatabaseCreator).Exists()) { throw new Exception("db does ont exist"); } } catch (Exception ex) { Assert.IsTrue(false, ex.Message); } } }
public void QueryTest() { using (STNDBContext context = new STNDBContext(new DbContextOptionsBuilder <STNDBContext>().UseNpgsql(this.connectionstring).Options)) { try { var testQuery = context.markers.ToList(); Assert.IsNotNull(testQuery, testQuery.Count.ToString()); } catch (Exception ex) { Assert.IsTrue(false, ex.Message); } finally { } } }