-
Notifications
You must be signed in to change notification settings - Fork 349
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding dynamic class support and tests for FieldNotEmptyAttribute.
- Loading branch information
Showing
9 changed files
with
140 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
34579,,Joe Test,1,5/1/2014 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
,Test LLC,Joe Test,1,5/1/2014 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
34579,,Joe Test,1, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
34568,ABC123 Company,,,04032015 | ||
34579,Test LLC,Joe Test,1,01052014 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using NUnit.Framework; | ||
|
||
namespace FileHelpers.Tests.CommonTests | ||
{ | ||
[TestFixture] | ||
public class FieldNotEmpty | ||
{ | ||
[Test] | ||
public void FieldNotEmpty1() | ||
{ | ||
Assert.DoesNotThrow(() => FileTest.Good.FieldNotEmpty1.ReadWithEngine<NotEmptyType>()); | ||
} | ||
} | ||
|
||
[DelimitedRecord(",")] | ||
public class NotEmptyType { | ||
[FieldNotEmpty()] | ||
public int CustomerID; | ||
|
||
[FieldNotEmpty()] | ||
public string CompanyName; | ||
|
||
public string ContactName; | ||
|
||
[FieldNullValue(true)] | ||
public bool IsActive; | ||
|
||
[FieldNotEmpty()] | ||
public DateTime? CreatedDate; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using FileHelpers.Tests.CommonTests; | ||
using NUnit.Framework; | ||
|
||
namespace FileHelpers.Tests.Errors | ||
{ | ||
[TestFixture] | ||
public class BadNotEmpty | ||
{ | ||
[Test] | ||
public void FieldNotEmpty1() | ||
{ | ||
Assert.Throws<ConvertException>(() => FileTest.Bad.FieldNotEmpty1.ReadWithEngine<NotEmptyType>()); | ||
} | ||
|
||
[Test] | ||
public void FieldNotEmpty2() | ||
{ | ||
Assert.Throws<ConvertException>(() => FileTest.Bad.FieldNotEmpty2.ReadWithEngine<NotEmptyType>()); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters