linux-packaging-mono/mcs/class/Mono.Data.Sqlite/Test/SqliteExceptionUnitTests.cs
Jo Shields 3c1f479b9d Imported Upstream version 4.0.0~alpha1
Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
2015-04-07 09:35:12 +01:00

40 lines
915 B
C#

// SqliteExceptionUnitTests.cs - NUnit Test Cases for Mono.Data.Sqlite.SqliteExceptions
//
// Author(s): Thomas Zoechling <thomas.zoechling@gmx.at>
using System;
using System.Data;
using System.IO;
using System.Text;
using Mono.Data.Sqlite;
using NUnit.Framework;
namespace MonoTests.Mono.Data.Sqlite
{
[TestFixture]
public class SqliteExceptionUnitTests
{
readonly static string _uri = "SqliteTest.db";
readonly static string _connectionString = "URI=file://" + _uri + ", version=3";
static SqliteConnection _conn = new SqliteConnection (_connectionString);
public SqliteExceptionUnitTests()
{
}
[Test]
[ExpectedException(typeof(SqliteException))]
public void WrongSyntax()
{
SqliteCommand insertCmd = new SqliteCommand("INSERT INTO t1 VALUES (,')",_conn);
using(_conn)
{
_conn.Open();
int res = insertCmd.ExecuteNonQuery();
Assert.AreEqual(res,1);
}
}
}
}