Beispiel #1
0
        public void ToHsqlIsolationLevel()
        {
            Assert.AreEqual(HsqlIsolationLevel.ReadCommited, HsqlConvert.ToHsqlIsolationLevel(IsolationLevel.ReadCommitted));
            Assert.AreEqual(HsqlIsolationLevel.ReadCommited, HsqlConvert.ToHsqlIsolationLevel(IsolationLevel.Unspecified));
            //
            Assert.AreEqual(HsqlIsolationLevel.ReadUncommited, HsqlConvert.ToHsqlIsolationLevel(IsolationLevel.ReadUncommitted));
            Assert.AreEqual(HsqlIsolationLevel.RepeatableRead, HsqlConvert.ToHsqlIsolationLevel(IsolationLevel.RepeatableRead));
            Assert.AreEqual(HsqlIsolationLevel.Serializable, HsqlConvert.ToHsqlIsolationLevel(IsolationLevel.Serializable));

            try
            {
                HsqlIsolationLevel actual = HsqlConvert.ToHsqlIsolationLevel(IsolationLevel.Chaos);

                Assert.Fail("There is no HsqlIsolationLevel corresponding to IsolationLevel.Chaos");
            }
            catch (ArgumentException ae)
            {
                Assert.AreEqual("isolationLevel", ae.ParamName);
                Assert.AreEqual("Unsupported Level: Chaos" + Environment.NewLine + "Parameter name: isolationLevel", ae.Message);
            }

            try
            {
                HsqlIsolationLevel actual = HsqlConvert.ToHsqlIsolationLevel(IsolationLevel.Snapshot);

                Assert.Fail("There is no HsqlIsolationLevel corresponding to IsolationLevel.Snapshot");
            }
            catch (ArgumentException ae)
            {
                Assert.AreEqual("isolationLevel", ae.ParamName);
                Assert.AreEqual("Unsupported Level: Snapshot" + Environment.NewLine + "Parameter name: isolationLevel", ae.Message);
            }
        }