mirror of
https://github.com/XFox111/GUTSchedule.git
synced 2026-04-22 06:58:01 +03:00
a07cb6fd3e
* Added unit tests, fixed and improved parser * Updated translation files * Updated unit tests to work with credentials * Updated validation CI config * Updated changelogs, improved CI/CD processes
40 lines
1.1 KiB
C#
40 lines
1.1 KiB
C#
using NUnit.Framework;
|
|
using System.Threading.Tasks;
|
|
using GUTSchedule.Models;
|
|
using System;
|
|
using Newtonsoft.Json;
|
|
using System.IO;
|
|
|
|
namespace GUTSchedule.Test
|
|
{
|
|
public class CabinetScheduleUnitTest
|
|
{
|
|
[Test]
|
|
public async Task ScheduleListTest()
|
|
{
|
|
dynamic secrets = JsonConvert.DeserializeObject(File.ReadAllText(Directory.GetCurrentDirectory() + "\\TestCredential.json"));
|
|
var list = await Parser.GetSchedule(new CabinetExportParameters
|
|
{
|
|
Email = secrets.testEmail,
|
|
Password = secrets.testPassword,
|
|
EndDate = DateTime.Today.AddDays(7),
|
|
StartDate = DateTime.Today
|
|
});
|
|
|
|
Assert.IsNotNull(list);
|
|
Assert.IsTrue(list.Count > 0);
|
|
|
|
|
|
Console.WriteLine("Events list:");
|
|
foreach (var i in list)
|
|
{
|
|
Console.WriteLine("--------------------------------------------------");
|
|
Console.WriteLine($"[{i.Group}] {i.Order}. {i.Name} ({i.Type})");
|
|
Console.WriteLine(i.Cabinet);
|
|
Console.WriteLine(i.StartTime.ToShortDateString());
|
|
Console.WriteLine($"{i.StartTime.ToShortTimeString()}-{i.EndTime.ToShortTimeString()}");
|
|
Console.WriteLine(i.Opponent);
|
|
}
|
|
}
|
|
}
|
|
} |