public void TestCreate()
        {
            var gateway = new UserDataGateway(new UserContext(DbContextOptions));

            gateway.Create("aUser");

            var names = Support.QuerySql("select name from users");

            Assert.Equal("aUser", names[0]["name"]);
        }
示例#2
0
        public void TestCreate()
        {
            var gateway = new TimeEntryDataGateway(new TimeEntryContext(DbContextOptions));

            gateway.Create(22, 12, DateTime.Now, 8);

            // todo...
            var projectIds = Support.QuerySql("select project_id from time_entries");

            Assert.Equal(22L, projectIds[0]["project_id"]);
        }
示例#3
0
        public void TestCreate()
        {
            var gateway = new AllocationDataGateway(new AllocationContext(DbContextOptions));

            gateway.Create(22, 12, DateTime.Now, DateTime.Now);

            // todo...
            var projectIds = Support.QuerySql("select project_id from allocations");

            Assert.Equal(22L, projectIds[0]["project_id"]);
        }
        public void TestCreate()
        {
            var gateway = new StoryDataGateway(new StoryContext(DbContextOptions));

            gateway.Create(22, "aStory");

            // todo...
            var projectIds = Support.QuerySql("select project_id from stories");

            Assert.Equal(22L, projectIds[0]["project_id"]);
        }
示例#5
0
        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"]);
        }
示例#6
0
        public void TestCreate()
        {
            Support.ExecSql(@"
            insert into users (id, name) values (12, 'Jack');
            insert into accounts (id, owner_id, name) values (1, 12, 'anAccount');");

            var gateway = new ProjectDataGateway(new ProjectContext(DbContextOptions));

            gateway.Create(1, "aProject");

            // todo...
            var projects = Support.QuerySql("select name from projects where account_id = 1");

            Assert.Equal("aProject", projects[0]["name"]);
        }