Beispiel #1
0
        public void StudentsTest(LoginConfig login)
        {
            var account = new VulcanAccount(login);

            account.InitializeStudents();

            Assert.True(account.Students.Count > 0);
        }
Beispiel #2
0
        public void TimetableTest(LoginConfig login)
        {
            var account = new VulcanAccount(login);

            account.InitializeStudents();

            var timetable = account.Students[0].GetTimetable(account, DateTime.Today);

            Assert.NotNull(timetable);
            Assert.NotEmpty(timetable.Days);
            Assert.NotEmpty(timetable.Days[0].Lessons);
        }
        protected override void OnAppearing()
        {
            Task.Run(async() =>
            {
                await Task.Delay(TimeSpan.FromSeconds(0.5));

                var account = new VulcanAccount(new LoginConfig("fakelog.cf", "Default", "*****@*****.**", "jan123", false));
                account.InitializeStudents();

                Device.BeginInvokeOnMainThread(() => {
                    Navigation.InsertPageBefore(new LuckyNumberPage($"Logged account with {account.Students.Count} students"), Navigation.NavigationStack[0]);
                    Navigation.PopToRootAsync(false);
                });
            });
        }
Beispiel #4
0
        public void LuckyNumberTest(LoginConfig login)
        {
            var account = new VulcanAccount(login);

            account.InitializeStudents();

            foreach (var school in account.Students.Select(x => x.School).DistinctBy(x => x.SchoolId))
            {
                var luckyNumber = school.GetLuckyNumber(account);
                if (login.IsTestLog)
                {
                    Assert.Equal(DateTime.Now.Hour <= 7 ? -1 : DateTime.Today.Day, luckyNumber);
                }
                _output.WriteLine($"{school.SchoolSymbol} have lucky {luckyNumber} today");
            }
        }