Skip to content

Commit

Permalink
Merge pull request #15 from M1nd3r/Formatting
Browse files Browse the repository at this point in the history
Fix formatting, fix scanner bug
  • Loading branch information
M1nd3r authored Aug 30, 2023
2 parents 9bbef1f + f9a068a commit a4f8867
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 13 deletions.
1 change: 0 additions & 1 deletion FolderSync/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,4 @@ private static void StopSyncLoopOnThread(SyncLoop syncLoop, Thread thread) {
while (thread.IsAlive)
Thread.Sleep(200);
}

}
5 changes: 3 additions & 2 deletions FolderSync/Scanner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ private void ProcessSubfolders(Folder folder, Queue<Folder> foldersToSolve) {
}
}
private void ProcessFilesInFolder(Folder folder) {
if (!TryGetFilesPaths(folder.Path, out var filePaths))
if (!TryGetFilesPaths(folder.Path, out var filesPaths))
return;
if (filesPaths == null)
return;
var filesPaths = Directory.GetFiles(folder.Path);
foreach (var filePath in filesPaths)
ScanAndAddFileToFolder(filePath, folder);
}
Expand Down
2 changes: 1 addition & 1 deletion FolderSyncTests/InputHandlerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace FolderSyncTests {
[TestClass]
public class InputHandlerTests {
private static string baseDir = AppDomain.CurrentDomain.BaseDirectory;
private static readonly string baseDir = AppDomain.CurrentDomain.BaseDirectory;
[TestMethod]
public void InputHandlerNullArgumentsTest() {
Assert.IsFalse(InputHandler.HandleInput(null!));
Expand Down
14 changes: 5 additions & 9 deletions FolderSyncTests/WithLogTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,18 @@
namespace FolderSyncTests {

[TestClass]
public class WithLogTests
{
private static WithLog mockWithLog = new MockWithLog();
public class WithLogTests {
private readonly static WithLog mockWithLog = new MockWithLog();

public class MockWithLog : WithLog
{
public class MockWithLog : WithLog {
}
[TestMethod]
public void CreateMockWithLogTest()
{
public void CreateMockWithLogTest() {
var withLog = new MockWithLog();
Assert.IsNotNull(withLog);
}
[TestMethod]
public void WithLogAddNullListenerTest()
{
public void WithLogAddNullListenerTest() {
Assert.ThrowsException<ArgumentNullException>(() => { mockWithLog.AddLogListener(null!); });
}
}
Expand Down

0 comments on commit a4f8867

Please sign in to comment.