示例#1
0
        public void ConnectionBeginTransactionOk_ReturnsTransaction()
        {
            var transaction = match(
                from connection in _connection
                select AppPrelude.beginTransaction(connection),
                conn => conn,
                err => err);

            Expect(transaction.IsRight, Is.True);
        }
示例#2
0
        public void ConnectionBeginTransactionThrows_ReturnsError()
        {
            _mockDbConnection.Setup(c => c.BeginTransaction()).Throws(new Exception("error"));

            var transaction = match(
                from connection in _connection
                select AppPrelude.beginTransaction(connection),
                Right: c => c,
                Left: err => err);

            Expect(match(transaction, trans => "", error => error.Message), Does.Contain("error"));
        }