Premiere commit - Omika
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
using System.Data;
|
||||
using System.Data.Odbc;
|
||||
using Omika.Data.Configuration;
|
||||
using Omika.Data.Connection;
|
||||
|
||||
namespace Omika.Tests.Connection;
|
||||
|
||||
public class OdbcConnectionFactoryTests
|
||||
{
|
||||
[Fact]
|
||||
public void Create_ReturnsOdbcConnection()
|
||||
{
|
||||
var factory = new OdbcConnectionFactory();
|
||||
var options = new HfsqlOptions
|
||||
{
|
||||
Driver = "HFSQL Client/Server",
|
||||
Server = "hfsql-serveur",
|
||||
Port = 4900,
|
||||
DatabaseName = "Omika"
|
||||
};
|
||||
|
||||
var connection = factory.Create(options);
|
||||
|
||||
Assert.IsType<OdbcConnection>(connection);
|
||||
Assert.Equal(ConnectionState.Closed, connection.State);
|
||||
Assert.Contains("hfsql-serveur", connection.ConnectionString);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Create_NullOptions_Throws()
|
||||
{
|
||||
var factory = new OdbcConnectionFactory();
|
||||
|
||||
Assert.Throws<ArgumentNullException>(() => factory.Create(null!));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user