-
Notifications
You must be signed in to change notification settings - Fork 247
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
issue 39 - detect the file encoding if possible. Fall back to ANSI if…
… not able to detect. issue 56 - make token replacement configurable and ignore anything that doesn't map and add token replacement switch to the command line.
- Loading branch information
1 parent
d1a25ec
commit f4bb6d3
Showing
17 changed files
with
376 additions
and
239 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
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
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
62 changes: 62 additions & 0 deletions
62
product/roundhouse.tests/infrastructure/filesystem/WindowsFileSystemAccessSpecs.cs
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,62 @@ | ||
using System.IO; | ||
|
||
namespace roundhouse.tests.infrastructure.filesystem | ||
{ | ||
using roundhouse.infrastructure.filesystem; | ||
using bdddoc.core; | ||
using developwithpassion.bdd.contexts; | ||
using developwithpassion.bdd.mbunit; | ||
using developwithpassion.bdd.mbunit.standard; | ||
using developwithpassion.bdd.mbunit.standard.observations; | ||
|
||
public class WindowsFileSystemAccessSpecs | ||
{ | ||
public abstract class concern_for_file_system : observations_for_a_sut_with_a_contract<FileSystemAccess, WindowsFileSystemAccess> | ||
{ | ||
protected static object result; | ||
|
||
context c = () => { }; | ||
} | ||
|
||
[Concern(typeof(WindowsFileSystemAccess))] | ||
public class when_reading_files_with_different_formats : concern_for_file_system | ||
{ | ||
protected static string utf8_file; | ||
protected static string ansi_file; | ||
|
||
because b = () => | ||
{ | ||
if (File.Exists(@".\infrastructure\filesystem\utf8encoded.txt")) | ||
{ | ||
utf8_file = sut.read_file_text(@".\infrastructure\filesystem\utf8encoded.txt"); | ||
} | ||
else | ||
{ | ||
utf8_file = sut.read_file_text(@".\\build_output\RoundhousE\infrastructure\filesystem\utf8encoded.txt"); | ||
} | ||
if (File.Exists(@".\infrastructure\filesystem\ansiencoded.txt")) | ||
{ | ||
ansi_file = sut.read_file_text(@".\infrastructure\filesystem\ansiencoded.txt"); | ||
} | ||
else | ||
{ | ||
ansi_file = sut.read_file_text(@".\build_output\RoundhousE\infrastructure\filesystem\ansiencoded.txt"); | ||
} | ||
}; | ||
|
||
[Observation] | ||
public void utf8_encoded_file_should_read_correctly() | ||
{ | ||
utf8_file.should_be_equal_to("INSERT INTO [dbo].[timmy]([value]) VALUES('Gã')"); | ||
} | ||
|
||
[Observation] | ||
public void ansi_encoded_file_should_read_correctly() | ||
{ | ||
ansi_file.should_be_equal_to("INSERT INTO [dbo].[timmy]([value]) VALUES('Gã')"); | ||
} | ||
} | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
product/roundhouse.tests/infrastructure/filesystem/ansiencoded.txt
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 @@ | ||
INSERT INTO [dbo].[timmy]([value]) VALUES('G�') |
1 change: 1 addition & 0 deletions
1
product/roundhouse.tests/infrastructure/filesystem/utf8encoded.txt
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 @@ | ||
INSERT INTO [dbo].[timmy]([value]) VALUES('Gã') |
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
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
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
Oops, something went wrong.