mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-25 23:28:33 -06:00
can create config from semester
This commit is contained in:
24
Management.Test/Features/ConfigurationTests.cs
Normal file
24
Management.Test/Features/ConfigurationTests.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using CanvasModel.EnrollmentTerms;
|
||||
|
||||
public class ConfigurationTests
|
||||
{
|
||||
[Test]
|
||||
public void TestCanCreateConfigFromTermAndDays()
|
||||
{
|
||||
|
||||
DateTime startAt = new DateTime(2022, 1, 1);
|
||||
DateTime endAt = new DateTime(2022, 1, 2);
|
||||
var canvasTerm = new EnrollmentTermModel(
|
||||
Id: 1,
|
||||
Name: "one",
|
||||
StartAt: startAt,
|
||||
EndAt: endAt
|
||||
);
|
||||
var daysOfWeek = new DayOfWeek[] { DayOfWeek.Monday };
|
||||
|
||||
var config = ConfigurationManagement.CreateFromTerm(canvasTerm, daysOfWeek);
|
||||
config.StartDate.Should().Be(startAt);
|
||||
config.EndDate.Should().Be(endAt);
|
||||
config.Days.Should().BeEquivalentTo(daysOfWeek);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user