- iOS: Add BackgroundSyncService, SyncScheduler, SyncWorker, BookmarkViewModel, FeedViewModel - iOS: Add BackgroundSyncService, SyncScheduler, SyncWorker services - Linux: Add settings-store.vala, State.vala signals, view widgets (FeedList, FeedDetail, AddFeed, Search, Settings, Bookmark) - Linux: Add bookmark-store.vala, bookmark vala model, search-service.vala - Android: Add NotificationService, NotificationManager, NotificationPreferencesStore - Android: Add BookmarkDao, BookmarkRepository, SettingsStore - Add unit tests for iOS, Android, Linux - Add integration tests - Add performance benchmarks - Update tasks and documentation Co-Authored-By: Paperclip <noreply@paperclip.ing>
76 lines
2.6 KiB
Vala
76 lines
2.6 KiB
Vala
/*
|
|
* NotificationServiceTests.vala
|
|
*
|
|
* Unit tests for Linux notification service using Gio.Notification API.
|
|
*/
|
|
|
|
using Gio;
|
|
using GLib;
|
|
using Gtk;
|
|
|
|
public class RSSuper.NotificationServiceTests {
|
|
|
|
private NotificationService? _service;
|
|
|
|
public static int main(string[] args) {
|
|
Test.init(ref args);
|
|
|
|
Test.add_func("/notification-service/create", () => {
|
|
var service = new NotificationService();
|
|
assert(service != null);
|
|
assert(service.is_available());
|
|
});
|
|
|
|
Test.add_func("/notification-service/create-with-params", () => {
|
|
var service = new NotificationService();
|
|
var notification = service.create("Test Title", "Test Body");
|
|
assert(notification != null);
|
|
});
|
|
|
|
Test.add_func("/notification-service/create-with-icon", () => {
|
|
var service = new NotificationService();
|
|
var notification = service.create("Test Title", "Test Body", "icon-name");
|
|
assert(notification != null);
|
|
});
|
|
|
|
Test.add_func("/notification-service/urgency-levels", () => {
|
|
var service = new NotificationService();
|
|
|
|
var normal = service.create("Test", "Body", Urgency.NORMAL);
|
|
assert(normal != null);
|
|
|
|
var low = service.create("Test", "Body", Urgency.LOW);
|
|
assert(low != null);
|
|
|
|
var critical = service.create("Test", "Body", Urgency.CRITICAL);
|
|
assert(critical != null);
|
|
});
|
|
|
|
Test.add_func("/notification-service/default-title", () => {
|
|
var service = new NotificationService();
|
|
var title = service.get_default_title();
|
|
assert(!string.IsNullOrEmpty(title));
|
|
});
|
|
|
|
Test.add_func("/notification-service/default-urgency", () => {
|
|
var service = new NotificationService();
|
|
var urgency = service.get_default_urgency();
|
|
assert(urgency == Urgency.NORMAL);
|
|
});
|
|
|
|
Test.add_func("/notification-service/set-default-title", () => {
|
|
var service = new NotificationService();
|
|
service.set_default_title("Custom Title");
|
|
assert(service.get_default_title() == "Custom Title");
|
|
});
|
|
|
|
Test.add_func("/notification-service/set-default-urgency", () => {
|
|
var service = new NotificationService();
|
|
service.set_default_urgency(Urgency.CRITICAL);
|
|
assert(service.get_default_urgency() == Urgency.CRITICAL);
|
|
});
|
|
|
|
return Test.run();
|
|
}
|
|
}
|