public void TestCreate() { Support.ExecSql("insert into users (id, name) values (12, 'Jack');"); var gateway = new AccountDataGateway(new AccountContext(DbContextOptions)); gateway.Create(12, "anAccount"); var names = Support.QuerySql("select name from accounts"); Assert.Equal("anAccount", names[0]["name"]); }
public void TestCreate() { var support = new TestDatabaseSupport(_dataSourceConfig); support.ExecSql(@" insert into users (id, name) values (12, 'Jack'); "); var template = new DatabaseTemplate(_dataSourceConfig); var gateway = new AccountDataGateway(template); gateway.Create(12, "anAccount"); var names = template.Query("select name from accounts", reader => reader.GetString(0), new List <DbParameter>()); Assert.Equal("anAccount", names.First()); }