Skip to content

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
GyulyVGC committed Dec 10, 2023
1 parent 45e6732 commit 9554eca
Showing 1 changed file with 29 additions and 29 deletions.
58 changes: 29 additions & 29 deletions src/gui/types/sniffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -616,15 +616,15 @@ mod tests {
let mut sniffer = Sniffer::new(&Configs::default(), Arc::new(Mutex::new(None)));

sniffer.update(Message::Style(StyleType::MonAmour));
assert_eq!(sniffer.style, StyleType::MonAmour);
assert_eq!(sniffer.settings.style, StyleType::MonAmour);
sniffer.update(Message::Style(StyleType::Day));
assert_eq!(sniffer.style, StyleType::Day);
assert_eq!(sniffer.settings.style, StyleType::Day);
sniffer.update(Message::Style(StyleType::Night));
assert_eq!(sniffer.style, StyleType::Night);
assert_eq!(sniffer.settings.style, StyleType::Night);
sniffer.update(Message::Style(StyleType::DeepSea));
assert_eq!(sniffer.style, StyleType::DeepSea);
assert_eq!(sniffer.settings.style, StyleType::DeepSea);
sniffer.update(Message::Style(StyleType::DeepSea));
assert_eq!(sniffer.style, StyleType::DeepSea);
assert_eq!(sniffer.settings.style, StyleType::DeepSea);
}

#[test]
Expand Down Expand Up @@ -922,16 +922,16 @@ mod tests {
fn test_correctly_update_language() {
let mut sniffer = Sniffer::new(&Configs::default(), Arc::new(Mutex::new(None)));

assert_eq!(sniffer.language, Language::EN);
assert_eq!(sniffer.settings.language, Language::EN);
assert_eq!(sniffer.traffic_chart.language, Language::EN);
sniffer.update(Message::LanguageSelection(Language::IT));
assert_eq!(sniffer.language, Language::IT);
assert_eq!(sniffer.settings.language, Language::IT);
assert_eq!(sniffer.traffic_chart.language, Language::IT);
sniffer.update(Message::LanguageSelection(Language::IT));
assert_eq!(sniffer.language, Language::IT);
assert_eq!(sniffer.settings.language, Language::IT);
assert_eq!(sniffer.traffic_chart.language, Language::IT);
sniffer.update(Message::LanguageSelection(Language::ZH));
assert_eq!(sniffer.language, Language::ZH);
assert_eq!(sniffer.settings.language, Language::ZH);
assert_eq!(sniffer.traffic_chart.language, Language::ZH);
}

Expand All @@ -940,17 +940,17 @@ mod tests {
let mut sniffer = Sniffer::new(&Configs::default(), Arc::new(Mutex::new(None)));

// initial default state
assert_eq!(sniffer.notifications.volume, 60);
assert_eq!(sniffer.settings.notifications.volume, 60);
assert_eq!(
sniffer.notifications.packets_notification,
sniffer.settings.notifications.packets_notification,
PacketsNotification {
threshold: None,
sound: Sound::Gulp,
previous_threshold: 750
}
);
assert_eq!(
sniffer.notifications.bytes_notification,
sniffer.settings.notifications.bytes_notification,
BytesNotification {
threshold: None,
byte_multiple: ByteMultiple::KB,
Expand All @@ -959,25 +959,25 @@ mod tests {
}
);
assert_eq!(
sniffer.notifications.favorite_notification,
sniffer.settings.notifications.favorite_notification,
FavoriteNotification {
notify_on_favorite: false,
sound: Sound::Swhoosh,
}
);
// change volume
sniffer.update(Message::ChangeVolume(95));
assert_eq!(sniffer.notifications.volume, 95);
assert_eq!(sniffer.settings.notifications.volume, 95);
assert_eq!(
sniffer.notifications.packets_notification,
sniffer.settings.notifications.packets_notification,
PacketsNotification {
threshold: None,
sound: Sound::Gulp,
previous_threshold: 750
}
);
assert_eq!(
sniffer.notifications.bytes_notification,
sniffer.settings.notifications.bytes_notification,
BytesNotification {
threshold: None,
byte_multiple: ByteMultiple::KB,
Expand All @@ -986,7 +986,7 @@ mod tests {
}
);
assert_eq!(
sniffer.notifications.favorite_notification,
sniffer.settings.notifications.favorite_notification,
FavoriteNotification {
notify_on_favorite: false,
sound: Sound::Swhoosh,
Expand All @@ -1001,17 +1001,17 @@ mod tests {
}),
false,
));
assert_eq!(sniffer.notifications.volume, 95);
assert_eq!(sniffer.settings.notifications.volume, 95);
assert_eq!(
sniffer.notifications.packets_notification,
sniffer.settings.notifications.packets_notification,
PacketsNotification {
threshold: Some(1122),
sound: Sound::None,
previous_threshold: 1122
}
);
assert_eq!(
sniffer.notifications.bytes_notification,
sniffer.settings.notifications.bytes_notification,
BytesNotification {
threshold: None,
byte_multiple: ByteMultiple::KB,
Expand All @@ -1020,7 +1020,7 @@ mod tests {
}
);
assert_eq!(
sniffer.notifications.favorite_notification,
sniffer.settings.notifications.favorite_notification,
FavoriteNotification {
notify_on_favorite: false,
sound: Sound::Swhoosh,
Expand All @@ -1036,17 +1036,17 @@ mod tests {
}),
true,
));
assert_eq!(sniffer.notifications.volume, 95);
assert_eq!(sniffer.settings.notifications.volume, 95);
assert_eq!(
sniffer.notifications.packets_notification,
sniffer.settings.notifications.packets_notification,
PacketsNotification {
threshold: Some(1122),
sound: Sound::None,
previous_threshold: 1122
}
);
assert_eq!(
sniffer.notifications.bytes_notification,
sniffer.settings.notifications.bytes_notification,
BytesNotification {
threshold: Some(3),
byte_multiple: ByteMultiple::GB,
Expand All @@ -1055,7 +1055,7 @@ mod tests {
}
);
assert_eq!(
sniffer.notifications.favorite_notification,
sniffer.settings.notifications.favorite_notification,
FavoriteNotification {
notify_on_favorite: false,
sound: Sound::Swhoosh,
Expand All @@ -1069,17 +1069,17 @@ mod tests {
}),
true,
));
assert_eq!(sniffer.notifications.volume, 95);
assert_eq!(sniffer.settings.notifications.volume, 95);
assert_eq!(
sniffer.notifications.packets_notification,
sniffer.settings.notifications.packets_notification,
PacketsNotification {
threshold: Some(1122),
sound: Sound::None,
previous_threshold: 1122
}
);
assert_eq!(
sniffer.notifications.bytes_notification,
sniffer.settings.notifications.bytes_notification,
BytesNotification {
threshold: Some(3),
byte_multiple: ByteMultiple::GB,
Expand All @@ -1088,7 +1088,7 @@ mod tests {
}
);
assert_eq!(
sniffer.notifications.favorite_notification,
sniffer.settings.notifications.favorite_notification,
FavoriteNotification {
notify_on_favorite: true,
sound: Sound::Pop
Expand Down

0 comments on commit 9554eca

Please sign in to comment.