22 lines
676 B
C#
22 lines
676 B
C#
namespace Tests.Stream;
|
|
|
|
public class StreamTest
|
|
{
|
|
[Theory]
|
|
[InlineData("thisfileexist.txt", true)]
|
|
[InlineData("thisfiledontexist.txt", false)]
|
|
|
|
public void ExistFileTest(string filePath, bool expected)
|
|
{
|
|
Assert.Equal(expected, global::Stream.Stream.ExistFile(filePath));
|
|
}
|
|
|
|
[Theory]
|
|
[InlineData("MyReplaceTestFile.txt", 'e', 'f')]
|
|
|
|
public void MyReplaceTest(string filePath, char toReplace, char replace)
|
|
{
|
|
global::Stream.Stream.MyReplace(filePath, toReplace, replace);
|
|
Assert.Equal("Bonjour,\nCfci fst un mfssagf df tfst.\nJ'fspfrf quf vous allfz rfussir vos fxams :D.\n", File.ReadAllText(filePath));
|
|
}
|
|
} |