-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Tests for
RetrieveFormatVersionFromInputFileName
(#116)
* Add Tests for `RetrieveFormatVersionFromInputFileName` * remve BOM
- Loading branch information
Showing
2 changed files
with
42 additions
and
8 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
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,27 @@ | ||
using System.IO; | ||
using EDILibrary; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
||
namespace EDILibraryTests; | ||
|
||
[TestClass] | ||
public class TemplateHelperTests | ||
{ | ||
[TestMethod] | ||
[DataRow("COMDIS1.0c.template", "1.0c")] | ||
[DataRow("UTILMDGG1.0a.template", "G1.0a")] | ||
public void Test_RetrieveFormatVersionFromInputFileName(string filename, string expectedFormatVersion) | ||
{ | ||
var actualFormatVersion = TemplateHelper.RetrieveFormatVersionFromInputFileName(filename); | ||
Assert.AreEqual(expectedFormatVersion, actualFormatVersion); | ||
} | ||
|
||
[TestMethod] | ||
public void Test_RetrieveFormatVersionFromInputFileName_ForPaths() | ||
{ | ||
var filepathAsString = $"Path{Path.DirectorySeparatorChar}To{Path.DirectorySeparatorChar}My{Path.DirectorySeparatorChar}Favourite{Path.DirectorySeparatorChar}Templates{Path.DirectorySeparatorChar}folder{Path.DirectorySeparatorChar}COMDIS1.0c.template"; | ||
var actualFormatVersion = TemplateHelper.RetrieveFormatVersionFromInputFileName(filepathAsString); | ||
Assert.AreEqual("1.0c", actualFormatVersion); | ||
} | ||
|
||
} |