コード例 #1
0
ファイル: RestrictionTest.cs プロジェクト: amigobv/UFO
        public void UpdateRestrictionTest()
        {
            if (database == null)
            {
                database = new Database(TestUtils.ConnString);
            }
            Assert.NotNull(database);

            var restrictionDao = new RestrictionDao(database);
            InsertDummyData(restrictionDao);
            Assert.Equal(items.Count, restrictionDao.Count());

            var currRestriction = items[0];
            currRestriction.Start = ALTER_START;

            restrictionDao.Update(currRestriction);
            var myNewRestriction = restrictionDao.FindById(currRestriction.Id);
            Assert.NotNull(myNewRestriction);
            Assert.Equal(ALTER_START, myNewRestriction.Start);
        }
コード例 #2
0
ファイル: RestrictionTest.cs プロジェクト: amigobv/UFO
        public void FindRestrictionByIdTest()
        {
            if (database == null)
            {
                database = new Database(TestUtils.ConnString);
            }
            Assert.NotNull(database);

            var restrictionDao = new RestrictionDao(database);
            InsertDummyData(restrictionDao);
            Assert.Equal(items.Count, restrictionDao.Count());

            var currRestriction = items[0];

            var myRestriction = restrictionDao.FindById(currRestriction.Id);
            Assert.NotNull(myRestriction);
            Assert.Equal(currRestriction, myRestriction);

            restrictionDao.Delete(myRestriction.Id);
            Assert.Equal(items.Count - 1, restrictionDao.Count());
        }