Пример #1
0
        public void CreateFishTest()
        {
            TDK.APaF.Database.MySQL.Database  myDB    = new TDK.APaF.Database.MySQL.Database(new TDK.APaF.Database.DatabaseConfig("localhost", "apaf2", "anuser", "mWZwbVCruMsh"));
            TDK.APaF.Model.Lists.BehaviorList behList = TDK.APaF.Model.Lists.BehaviorList.CreateDefaultList();

            TDK.APaF.Model.FishClass fish = new TDK.APaF.Model.FishClass()
            {
                ID              = -1,
                AquaLogCode     = "Test 1",
                CreatedByUser   = "******",
                CreatedDateTime = DateTime.Now,
                CurrentVersion  = 1.0M,
                DataSource      = EnumDataSource.Aqualog,
            };
            fish.Behavior.Add(behList[0]);
            fish.Behavior.Add(behList[1]);

            Assert.AreNotEqual(-1, fish.ID);
        }
Пример #2
0
        public void UndeleteCreatureTest()
        {
            bool okResult = false;

            try
            {
                TDK.APaF.Database.MySQL.Database myDB = (TDK.APaF.Database.MySQL.Database)getDBConnection();
                okResult = myDB.UndeleteCreature(1);
            }
            catch (TDK.APaF.Database.Exceptions.CreatureNotFound)
            {
                Assert.Inconclusive("Creature not found");
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.Message);
            }
            Assert.IsTrue(okResult);
        }
Пример #3
0
        public void GetOldVersionTest()
        {
            List <Model.CreatureIdentification> lst = null;

            try
            {
                TDK.APaF.Database.MySQL.Database myDB = (TDK.APaF.Database.MySQL.Database)getDBConnection();
                lst = myDB.GetOldVersion(1);
            }
            catch (TDK.APaF.Database.Exceptions.CreatureNotFound)
            {
                Assert.Inconclusive("Creature not found");
            }
            catch (Exception ex)
            {
                Assert.Fail(ex.Message);
            }
            Assert.IsNotNull(lst);
        }
Пример #4
0
        public void CreateFishTest()
        {
            TDK.APaF.Database.MySQL.Database myDB = new TDK.APaF.Database.MySQL.Database(new TDK.APaF.Database.DatabaseConfig("localhost", "apaf2", "anuser", "mWZwbVCruMsh"));
            TDK.APaF.Model.Lists.BehaviorList behList = TDK.APaF.Model.Lists.BehaviorList.CreateDefaultList();

            TDK.APaF.Model.FishClass fish = new TDK.APaF.Model.FishClass()
            {
                ID = -1,
                AquaLogCode = "Test 1",
                CreatedByUser = "******",
                CreatedDateTime = DateTime.Now,
                CurrentVersion = 1.0M,
                DataSource = EnumDataSource.Aqualog,

            };
            fish.Behavior.Add(behList[0]);
            fish.Behavior.Add(behList[1]);

            Assert.AreNotEqual(-1, fish.ID);
        }
Пример #5
0
        public void DatabaseTest()
        {
            TDK.APaF.Database.MySQL.Database myDB = (TDK.APaF.Database.MySQL.Database)getDBConnection();

            Assert.IsNotNull(myDB);
        }