Skip to content

Commit d5c4232

Browse files
cleanup
1 parent 39c55bc commit d5c4232

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/modules/Hosts/Hosts.Tests/HostsServiceTest.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ public async Task Save_Hidden_Hosts()
282282
}
283283

284284
[TestMethod]
285-
public async Task Hosts_Backup_Not_Done()
285+
public async Task Hosts_Backup_Not_Executed()
286286
{
287287
var content =
288288
@"10.1.1.1 host host.local # comment
@@ -307,7 +307,7 @@ 10.1.1.2 host2 host2.local # another comment
307307
}
308308

309309
[TestMethod]
310-
public async Task Hosts_Backup_Done()
310+
public async Task Hosts_Backup_Executed_Once()
311311
{
312312
var content =
313313
@"10.1.1.1 host host.local # comment
@@ -326,6 +326,7 @@ 10.1.1.2 host2 host2.local # another comment
326326
var entries = data.Entries.ToList();
327327
entries.Add(new Entry(0, "10.1.1.30", "host30 host30.local", "new entry", false));
328328
await service.WriteAsync(data.AdditionalLines, data.Entries);
329+
await service.WriteAsync(data.AdditionalLines, data.Entries);
329330

330331
Assert.AreEqual(1, fileSystem.Directory.GetFiles(BackupPath).Length);
331332
var backupContent = fileSystem.File.ReadAllText(fileSystem.Directory.GetFiles(BackupPath)[0]);

src/modules/Hosts/HostsUILib/Helpers/BackupManager.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ public void DeleteBackups()
4747
{
4848
case HostsDeleteBackupMode.Count:
4949
DeleteBackupsByCount(_userSettings.DeleteBackupsCount);
50-
return;
50+
break;
5151
case HostsDeleteBackupMode.Age:
5252
DeleteBackupsByAge(_userSettings.DeleteBackupsDays, _userSettings.DeleteBackupsCount);
53-
return;
53+
break;
5454
}
5555
}
5656

src/modules/Hosts/HostsUILib/Helpers/IHostsService.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace HostsUILib.Helpers
1212
{
1313
public interface IHostsService
1414
{
15-
static string HostsFilePath { get; }
15+
string HostsFilePath { get; }
1616

1717
event EventHandler FileChanged;
1818

0 commit comments

Comments
 (0)