Esempio n. 1
0
 public void GetOraConnectionTest()
 {            
     var target = new OracleAccess();
     OracleConnection expected ;
     using (expected = new OracleConnection(_oradb))
     {
         expected.Open();                
     }
     OracleConnection actual;
     actual = target.GetOraConnection();
     Assert.AreEqual(expected.InstanceName, actual.InstanceName);
     //Assert.Inconclusive("Verify the correctness of this test method.");
 }
Esempio n. 2
0
        public void Datasettest()
        {
            var target = new OracleAccess();

            var themaNew = new BeheerContextEntity
                               {
                                   DataKeyValue = "aaaDwight" + DateTime.Now,
                                   Tablename = "thema",
                                   DataKeyName = "themanaam"
                               };
            string qry = @"select id, {0} from {1} where {0} = '{2}'";
            qry = string.Format(CultureInfo.InvariantCulture, qry, themaNew.DataKeyName, themaNew.Tablename, 
                themaNew.DataKeyValue);

            int rowsAffected = target.Insert(themaNew);
            var ds = target.GetDaBusinessObject(qry,themaNew);

        }
Esempio n. 3
0
        public void DeleteThemasTest()
        {
            var target = new OracleAccess();

            var thema = new BeheerContextEntity
            {
                DataKeyValue = "aaaDwight" + DateTime.Now,
                Tablename = "thema",
                DataKeyName = "themanaam"
            };

            Assert.IsTrue(target.Insert(thema) > 0);

            int rowsAffected = target.Delete(thema);

            Assert.IsTrue(rowsAffected == 1);
            var expected = target.GetBusinessObject(thema.Tablename, thema.DataKeyName,
                thema.DataKeyValue) as BeheerContextEntity;
            Assert.AreEqual(expected, null);

        }
Esempio n. 4
0
        public void UpdateThemasTest()
        {
            var target = new OracleAccess();            

            string nu = DateTime.Now.ToString();
            var themaOld = new BeheerContextEntity
            {
                DataKeyValue = "aaP" + nu,
                Tablename = "thema",
                DataKeyName = "themanaam"
            };
            target.Insert(themaOld);

            var themaNew= new BeheerContextEntity
                                              {
                                                  DataKeyValue = "aapje" + nu,
                                                  Tablename = "thema",
                                                  DataKeyName = "themanaam"
                                              }; 
            int rowsAffected  = target.Update(themaOld,themaNew);
            Assert.AreEqual(1,rowsAffected );

            var expected = target.GetBusinessObject(themaNew.Tablename, themaNew.DataKeyName,
                themaNew.DataKeyValue) as BeheerContextEntity;
            // ReSharper disable PossibleNullReferenceException
            Assert.AreEqual(expected.DataKeyValue, themaNew.DataKeyValue);
            // ReSharper restore PossibleNullReferenceException
            Assert.AreEqual(expected.Tablename, themaNew.Tablename);
            Assert.AreEqual(expected.DataKeyName, themaNew.DataKeyName);
        }
Esempio n. 5
0
        public void InsertThemasTest()
        {
            var target = new OracleAccess();        

            var themaNew = new BeheerContextEntity
            {
                DataKeyValue = "aaaDwight" + DateTime.Now,
                Tablename = "thema",
                DataKeyName = "themanaam"
            };
            int rowsAffected = target.Insert(themaNew);
            var expected = target.GetBusinessObject(themaNew.Tablename, themaNew.DataKeyName, 
                themaNew.DataKeyValue) as BeheerContextEntity;

            Assert.IsTrue(rowsAffected == 1);
            // ReSharper disable PossibleNullReferenceException
            Assert.AreEqual(expected.DataKeyValue, themaNew.DataKeyValue);
            // ReSharper restore PossibleNullReferenceException
            Assert.AreEqual(expected.Tablename, themaNew.Tablename);
            Assert.AreEqual(expected.DataKeyName, themaNew.DataKeyName);

        }
Esempio n. 6
0
        public void GetThemasTest()
        {
            var target = new OracleAccess();
            bool actual;
            actual = target.SetOraConnection();

            Assert.AreEqual(true, actual);
            IList<BeheerContextEntity> list = target.GetBusinessObjects("thema", "themanaam");
            Assert.IsTrue(list.Count>0);

        }