Skip to content

Commit

Permalink
[add] ConfigurationManagerBasedDbConnectionSettings tests
Browse files Browse the repository at this point in the history
  • Loading branch information
i4004 committed Jan 14, 2024
1 parent 2f92226 commit 9184c32
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Simplify.FluentNHibernate.FrameworkTests/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<add key="UserName" value="foouser" />
<add key="UserPassword" value="foopassword" />
<add key="ShowSql" value="true" />
<add key="ShowSqlOutputType" value="Trace" />
</DatabaseConnectionSettings>

<system.data>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using Microsoft.Extensions.Configuration;
using NUnit.Framework;
using Simplify.FluentNHibernate.Settings;
using Simplify.FluentNHibernate.Settings.Impl;

namespace Simplify.FluentNHibernate.Tests.Settings.Impl;

[TestFixture]
public class ConfigurationManagerBasedDbConnectionSettingsTests
{
[Test]
public void InitializeFromConfigOracleClient_CorrectConfig_NoExceptions()
{
// Arrange & Act
var settings = new ConfigurationBasedDbConnectionSettings();

Check failure on line 15 in src/Simplify.FluentNHibernate.FrameworkTests/Impl/ConfigurationManagerBasedDbConnectionSettingsTests.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

There is no argument given that corresponds to the required parameter 'configuration' of 'ConfigurationBasedDbConnectionSettings.ConfigurationBasedDbConnectionSettings(IConfiguration, string)'

Check failure on line 15 in src/Simplify.FluentNHibernate.FrameworkTests/Impl/ConfigurationManagerBasedDbConnectionSettingsTests.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

There is no argument given that corresponds to the required parameter 'configuration' of 'ConfigurationBasedDbConnectionSettings.ConfigurationBasedDbConnectionSettings(IConfiguration, string)'

// Assert

Assert.That(settings.ServerName, Is.EqualTo("localhost"));
Assert.That(settings.DataBaseName, Is.EqualTo("foodatabase"));
Assert.That(settings.UserName, Is.EqualTo("foouser"));
Assert.That(settings.UserPassword, Is.EqualTo("foopassword"));
Assert.That(settings.ShowSql, Is.EqualTo(true));
Assert.That(settings.ShowSqlOutputType, Is.EqualTo(ShowSqlOutputType.Trace));
Assert.That(settings.Port, Is.EqualTo(1231));
}
}

0 comments on commit 9184c32

Please sign in to comment.