-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathBackupScheduleTests.cs
More file actions
49 lines (44 loc) · 1.36 KB
/
Copy pathBackupScheduleTests.cs
File metadata and controls
49 lines (44 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
using BorgMate.Models;
using BorgMate.Views.Converters;
namespace BorgMate.Tests;
public class BackupScheduleTests
{
[Fact]
public void FormatSchedule_Daily()
{
var schedule = new BackupSchedule { Frequency = ScheduleFrequency.Daily, Hour = 2, Minute = 30 };
Assert.Contains("02:30", ScheduleDisplayConverter.FormatSchedule(schedule));
}
[Fact]
public void FormatSchedule_Weekly()
{
var schedule = new BackupSchedule
{
Frequency = ScheduleFrequency.Weekly,
Hour = 3, Minute = 0, DayOfWeek = DayOfWeek.Monday
};
Assert.Contains("03:00", ScheduleDisplayConverter.FormatSchedule(schedule));
}
[Fact]
public void FormatSchedule_Monthly()
{
var schedule = new BackupSchedule
{
Frequency = ScheduleFrequency.Monthly,
Hour = 4, Minute = 0, DayOfMonth = 15
};
var display = ScheduleDisplayConverter.FormatSchedule(schedule);
Assert.Contains("04:00", display);
Assert.Contains("15", display);
}
[Fact]
public void FormatSchedule_EveryNHours()
{
var schedule = new BackupSchedule
{
Frequency = ScheduleFrequency.EveryNHours,
Minute = 0, IntervalHours = 6
};
Assert.NotEmpty(ScheduleDisplayConverter.FormatSchedule(schedule));
}
}