public void UnknownDbContextNameTest(string ctxName, string host, int port, string db, string uname, string pw, string provider) { try { DbCredential credential = null; if (string.IsNullOrEmpty(provider)) { credential = new DbCredential(host, port, db, uname, pw); } else { credential = new DbCredential(host, port, db, uname, pw, provider); } BaseDbContext opt = FactoryDbContext.CreateDbContextObject(ctxName, credential); Assert.True(false, "Exception shoud be throw for unknow application name!!!"); } catch (Exception e) { Assert.True(true, e.Message); } }
public void knownDbContextNameTest(string ctxName, string host, int port, string db, string uname, string pw, string provider) { try { DbCredential credential = null; if (string.IsNullOrEmpty(provider)) { credential = new DbCredential(host, port, db, uname, pw); } else { credential = new DbCredential(host, port, db, uname, pw, provider); } BaseDbContext opt = FactoryDbContext.CreateDbContextObject(ctxName, credential); Assert.IsNotNull(opt, "Object created from factory must be null!!!"); } catch (Exception e) { Assert.True(false, e.Message); } }