예제 #1
0
        public void ShouldEnable()
        {
            var reminderService = new ReminderService(1);

            Task.Run(() =>
                     reminderService.SubsribeAndRun(() => Console.WriteLine("Напоминание, будь челом бля")),
                     reminderService.Reminder.CancellationTokenSource.Token);

            Thread.Sleep(3000);
            reminderService.Exit();
            reminderService.Reminder.CancellationTokenSource.IsCancellationRequested.Should(Be.True);
        }