mirror of
https://github.com/XFox111/GUTSchedule.git
synced 2026-04-22 06:58:01 +03:00
Parser improvements and fixes, Tests (#23)
* 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
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user