Skip to content

Commit a4f8867

Browse files
authored
Merge pull request #15 from M1nd3r/Formatting
Fix formatting, fix scanner bug
2 parents 9bbef1f + f9a068a commit a4f8867

File tree

4 files changed

+9
-13
lines changed

4 files changed

+9
-13
lines changed

FolderSync/Program.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,4 @@ private static void StopSyncLoopOnThread(SyncLoop syncLoop, Thread thread) {
3232
while (thread.IsAlive)
3333
Thread.Sleep(200);
3434
}
35-
3635
}

FolderSync/Scanner.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,10 @@ private void ProcessSubfolders(Folder folder, Queue<Folder> foldersToSolve) {
4242
}
4343
}
4444
private void ProcessFilesInFolder(Folder folder) {
45-
if (!TryGetFilesPaths(folder.Path, out var filePaths))
45+
if (!TryGetFilesPaths(folder.Path, out var filesPaths))
46+
return;
47+
if (filesPaths == null)
4648
return;
47-
var filesPaths = Directory.GetFiles(folder.Path);
4849
foreach (var filePath in filesPaths)
4950
ScanAndAddFileToFolder(filePath, folder);
5051
}

FolderSyncTests/InputHandlerTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace FolderSyncTests {
44
[TestClass]
55
public class InputHandlerTests {
6-
private static string baseDir = AppDomain.CurrentDomain.BaseDirectory;
6+
private static readonly string baseDir = AppDomain.CurrentDomain.BaseDirectory;
77
[TestMethod]
88
public void InputHandlerNullArgumentsTest() {
99
Assert.IsFalse(InputHandler.HandleInput(null!));

FolderSyncTests/WithLogTests.cs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,18 @@
33
namespace FolderSyncTests {
44

55
[TestClass]
6-
public class WithLogTests
7-
{
8-
private static WithLog mockWithLog = new MockWithLog();
6+
public class WithLogTests {
7+
private readonly static WithLog mockWithLog = new MockWithLog();
98

10-
public class MockWithLog : WithLog
11-
{
9+
public class MockWithLog : WithLog {
1210
}
1311
[TestMethod]
14-
public void CreateMockWithLogTest()
15-
{
12+
public void CreateMockWithLogTest() {
1613
var withLog = new MockWithLog();
1714
Assert.IsNotNull(withLog);
1815
}
1916
[TestMethod]
20-
public void WithLogAddNullListenerTest()
21-
{
17+
public void WithLogAddNullListenerTest() {
2218
Assert.ThrowsException<ArgumentNullException>(() => { mockWithLog.AddLogListener(null!); });
2319
}
2420
}

0 commit comments

Comments
 (0)