Beispiel #1
0
		public void UT_InsGetDelSequence() {
			DO_Word _word;
			try {
				_word = new DO_Word();
			} catch (Exception e) {
				Assert.IsTrue(false, "some error trying to instantiate DO_Word\n---\n{0}\n---", e.Message);
				return; // no need...
			}
			_word.Connection.Open();
			_word.Connection.Transaction.Begin();



			_word.Fields.DeleteThisTestField = true;
			long _idword;
			try {
				_idword = _word.insObject(true);
			} catch (Exception e) {
				Assert.IsTrue(false, "some error running insObject\n---\n{0}\n---", e.Message);
				return; // no need...
			}
			Assert.IsTrue(_idword > 0L, "failed to retrieve identity seed (insObject)");
			_word.clrObject();
			bool _exists;
			try {
				_exists = _word.getObject(_idword);
			} catch (Exception e) {
				Assert.IsTrue(false, "some error running getObject\n---\n{0}\n---", e.Message);
				return; // no need...
			}
			Assert.IsTrue(_exists, "can't read inserted item (getObject)");
			Assert.AreEqual(true, _word.Fields.DeleteThisTestField, "inserted values difer those just read (insObject/getObject)");
			try {
				_word.delObject(_idword);
			} catch (Exception e) {
				Assert.IsTrue(false, "some error trying to delete (delObject)\n---\n{0}\n---", e.Message);
				return; // no need...
			}



			_word.Connection.Transaction.Rollback();
			_word.Connection.Transaction.Terminate();
			_word.Connection.Close();
			_word.Dispose(); _word = null;
		}