Пример #1
0
        public void ReadWrite()
        {
            if (Dialect is Oracle8iDialect)
            {
                Assert.Ignore("The Oracle dialect maps currency as Number(20, 2), this test can only fail.");
            }

            const decimal expected = 5.6435M;

            var basic = new CurrencyClass {
                CurrencyValue = expected
            };
            ISession s       = OpenSession();
            object   savedId = s.Save(basic);

            s.Flush();
            s.Close();

            s     = OpenSession();
            basic = s.Load <CurrencyClass>(savedId);

            Assert.AreEqual(expected, basic.CurrencyValue);

            s.Delete(basic);
            s.Flush();
            s.Close();
        }
		public void ReadWrite()
		{
			const decimal expected = 5.6435M;

			var basic = new CurrencyClass {CurrencyValue = expected};
			ISession s = OpenSession();
			object savedId = s.Save(basic);
			s.Flush();
			s.Close();

			s = OpenSession();
			basic = s.Load<CurrencyClass>(savedId);

			Assert.AreEqual(expected, basic.CurrencyValue);

			s.Delete(basic);
			s.Flush();
			s.Close();
		}
Пример #3
0
        public void ReadWrite()
        {
            const decimal expected = 5.6435M;

            var basic = new CurrencyClass {
                CurrencyValue = expected
            };
            ISession s       = OpenSession();
            object   savedId = s.Save(basic);

            s.Flush();
            s.Close();

            s     = OpenSession();
            basic = s.Load <CurrencyClass>(savedId);

            Assert.AreEqual(expected, basic.CurrencyValue);

            s.Delete(basic);
            s.Flush();
            s.Close();
        }
        public async Task ReadWriteAsync()
        {
            const decimal expected = 5.6435M;

            var basic = new CurrencyClass {
                CurrencyValue = expected
            };
            ISession s       = OpenSession();
            object   savedId = await(s.SaveAsync(basic));

            await(s.FlushAsync());
            s.Close();

            s     = OpenSession();
            basic = await(s.LoadAsync <CurrencyClass>(savedId));

            Assert.AreEqual(expected, basic.CurrencyValue);

            await(s.DeleteAsync(basic));
            await(s.FlushAsync());
            s.Close();
        }