Skip to content

Commit ea33f7c

Browse files
David EllingsworthDavid Ellingsworth
David Ellingsworth
authored and
David Ellingsworth
committed
GH-3530: Add tests for float type.
1 parent 3610073 commit ea33f7c

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

src/NHibernate.Test/NHSpecificTest/GH3530/Entities.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ public class DateTimeEntity : DataEntity<DateTime> { }
1717

1818
public class DoubleEntity : DataEntity<double> { }
1919
public class DecimalEntity : DataEntity<decimal> { }
20+
public class FloatEntity : DataEntity<float> { }
2021
public class NHDateTimeEntity : DataEntity<DateTime> { }

src/NHibernate.Test/NHSpecificTest/GH3530/Fixture.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ protected override void CreateSchema()
4141
CreateTable("DateTime");
4242
CreateTable("Double");
4343
CreateTable("Decimal");
44+
CreateTable("Float");
4445

4546
base.CreateSchema();
4647
}
@@ -182,6 +183,14 @@ public void TestInteger(CultureInfo from, CultureInfo to)
182183
PerformTest<int, IntegerEntity>(from, to, integerValue, (expected, actual) => Assert.AreEqual(expected, actual));
183184
}
184185

186+
[Test, TestCaseSource(nameof(GetTestCases))]
187+
public void TestFloat(CultureInfo from, CultureInfo to)
188+
{
189+
float floatValue = 12.3f;
190+
191+
PerformTest<float, FloatEntity>(from, to, floatValue, (expected, actual) => Assert.AreEqual(expected, actual));
192+
}
193+
185194
private CultureInfo CurrentCulture
186195
{
187196
get => CultureInfo.CurrentCulture;

src/NHibernate.Test/NHSpecificTest/GH3530/Mappings.hbm.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
<id name="Id" generator="guid.comb" />
2424
<property name="DataValue" column="DataValue"/>
2525
</class>
26+
<class name="FloatEntity" schema-action="none">
27+
<id name="Id" generator="guid.comb"/>
28+
<property name="DataValue" column="DataValue"/>
29+
</class>
2630

2731
<!--
2832
The following classes will be exported as expected by the SchemaExport.

0 commit comments

Comments
 (0)