Skip to content

Commit c662903

Browse files
committed
Adding unit test cases for nullable decimal
1 parent 3f534c6 commit c662903

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Mvc.Jquery.DataTables.Tests/DummyPocos/SomeModel.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@ public class SomeModel
1212
public double Scale { get; set; }
1313
public DateTime When { get; set; }
1414
public bool Discounted { get; set; }
15+
public decimal? Cost { get; set; }
1516
}
1617
}

Mvc.Jquery.DataTables.Tests/FilterTests.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ public void Setup()
2424
DisplayName = "Cheddar",
2525
Id = 123,
2626
Scale = 123.456d,
27-
Discounted = true
27+
Discounted = true,
28+
Cost = 123
2829
}
2930
}.AsQueryable();
3031

@@ -50,6 +51,8 @@ public void Setup()
5051
[TestCase("^456$", typeof(int), false)] //exact query, isnt match
5152
[TestCase("123", typeof(int), true)] //query, is match
5253
[TestCase("456", typeof(int), false)] //query, isnt match
54+
[TestCase("123", typeof(decimal?), true)] //query, is match
55+
[TestCase("456", typeof(decimal?), false)] //query, isnt match
5356
public void SearchQueryTests(string searchString, Type colType, bool returnsResult)
5457
{
5558
var col = columns.First(c => c.Item2.Type == colType).Item1;

0 commit comments

Comments
 (0)