mirror of
https://github.com/GyulyVGC/sniffnet.git
synced 2026-10-25 16:41:21 +00:00
fix tests
This commit is contained in:
parent
85a65966aa
commit
b165fcd97c
2 changed files with 5 additions and 90 deletions
|
|
@ -84,7 +84,7 @@ mod tests {
|
|||
use std::collections::VecDeque;
|
||||
|
||||
use crate::chart::manage_chart_data::{get_max, get_min, update_charts_data};
|
||||
use crate::{ChartType, RunTimeData, TrafficChart};
|
||||
use crate::{ChartType, Language, RunTimeData, StyleType, TrafficChart};
|
||||
|
||||
#[test]
|
||||
fn test_chart_data_updates() {
|
||||
|
|
@ -162,12 +162,9 @@ mod tests {
|
|||
max_received_bytes: 21000,
|
||||
min_sent_packets: -1000,
|
||||
max_received_packets: 21000,
|
||||
color_mix: 0.0,
|
||||
color_incoming: Default::default(),
|
||||
color_outgoing: Default::default(),
|
||||
color_font: Default::default(),
|
||||
language: Language::default(),
|
||||
chart_type: ChartType::Packets,
|
||||
language: Default::default(),
|
||||
style: StyleType::default(),
|
||||
};
|
||||
let mut runtime_data = RunTimeData {
|
||||
all_bytes: 0,
|
||||
|
|
|
|||
|
|
@ -522,8 +522,6 @@ mod tests {
|
|||
use crate::countries::types::country::Country;
|
||||
use crate::gui::components::types::my_modal::MyModal;
|
||||
use crate::gui::pages::types::settings_page::SettingsPage;
|
||||
use crate::gui::styles::style_constants::get_color_mix_chart;
|
||||
use crate::gui::styles::types::palette::to_rgb_color;
|
||||
use crate::gui::types::message::Message;
|
||||
use crate::networking::types::host::Host;
|
||||
use crate::notifications::types::logged_notification::{
|
||||
|
|
@ -534,8 +532,8 @@ mod tests {
|
|||
};
|
||||
use crate::notifications::types::sound::Sound;
|
||||
use crate::{
|
||||
get_colors, AppProtocol, ByteMultiple, ChartType, InfoTraffic, IpVersion, Language,
|
||||
ReportSortType, RunningPage, Sniffer, Status, StyleType, TransProtocol,
|
||||
AppProtocol, ByteMultiple, ChartType, InfoTraffic, IpVersion, Language, ReportSortType,
|
||||
RunningPage, Sniffer, Status, StyleType, TransProtocol,
|
||||
};
|
||||
|
||||
#[test]
|
||||
|
|
@ -659,94 +657,14 @@ mod tests {
|
|||
|
||||
sniffer.update(Message::Style(StyleType::MonAmour));
|
||||
assert_eq!(sniffer.style, StyleType::MonAmour);
|
||||
assert_eq!(
|
||||
sniffer.traffic_chart.color_font,
|
||||
to_rgb_color(get_colors(StyleType::MonAmour).text_body)
|
||||
);
|
||||
assert_eq!(
|
||||
sniffer.traffic_chart.color_outgoing,
|
||||
to_rgb_color(get_colors(StyleType::MonAmour).outgoing)
|
||||
);
|
||||
assert_eq!(
|
||||
sniffer.traffic_chart.color_incoming,
|
||||
to_rgb_color(get_colors(StyleType::MonAmour).secondary)
|
||||
);
|
||||
assert_eq!(
|
||||
sniffer.traffic_chart.color_mix,
|
||||
get_color_mix_chart(StyleType::MonAmour)
|
||||
);
|
||||
sniffer.update(Message::Style(StyleType::Day));
|
||||
assert_eq!(sniffer.style, StyleType::Day);
|
||||
assert_eq!(
|
||||
sniffer.traffic_chart.color_font,
|
||||
to_rgb_color(get_colors(StyleType::Day).text_body)
|
||||
);
|
||||
assert_eq!(
|
||||
sniffer.traffic_chart.color_outgoing,
|
||||
to_rgb_color(get_colors(StyleType::Day).outgoing)
|
||||
);
|
||||
assert_eq!(
|
||||
sniffer.traffic_chart.color_incoming,
|
||||
to_rgb_color(get_colors(StyleType::Day).secondary)
|
||||
);
|
||||
assert_eq!(
|
||||
sniffer.traffic_chart.color_mix,
|
||||
get_color_mix_chart(StyleType::Day)
|
||||
);
|
||||
sniffer.update(Message::Style(StyleType::Night));
|
||||
assert_eq!(sniffer.style, StyleType::Night);
|
||||
assert_eq!(
|
||||
sniffer.traffic_chart.color_font,
|
||||
to_rgb_color(get_colors(StyleType::Night).text_body)
|
||||
);
|
||||
assert_eq!(
|
||||
sniffer.traffic_chart.color_outgoing,
|
||||
to_rgb_color(get_colors(StyleType::Night).outgoing)
|
||||
);
|
||||
assert_eq!(
|
||||
sniffer.traffic_chart.color_incoming,
|
||||
to_rgb_color(get_colors(StyleType::Night).secondary)
|
||||
);
|
||||
assert_eq!(
|
||||
sniffer.traffic_chart.color_mix,
|
||||
get_color_mix_chart(StyleType::Night)
|
||||
);
|
||||
sniffer.update(Message::Style(StyleType::DeepSea));
|
||||
assert_eq!(sniffer.style, StyleType::DeepSea);
|
||||
assert_eq!(
|
||||
sniffer.traffic_chart.color_font,
|
||||
to_rgb_color(get_colors(StyleType::DeepSea).text_body)
|
||||
);
|
||||
assert_eq!(
|
||||
sniffer.traffic_chart.color_outgoing,
|
||||
to_rgb_color(get_colors(StyleType::DeepSea).outgoing)
|
||||
);
|
||||
assert_eq!(
|
||||
sniffer.traffic_chart.color_incoming,
|
||||
to_rgb_color(get_colors(StyleType::DeepSea).secondary)
|
||||
);
|
||||
assert_eq!(
|
||||
sniffer.traffic_chart.color_mix,
|
||||
get_color_mix_chart(StyleType::DeepSea)
|
||||
);
|
||||
sniffer.update(Message::Style(StyleType::DeepSea));
|
||||
assert_eq!(sniffer.style, StyleType::DeepSea);
|
||||
assert_eq!(
|
||||
sniffer.traffic_chart.color_font,
|
||||
to_rgb_color(get_colors(StyleType::DeepSea).text_body)
|
||||
);
|
||||
assert_eq!(
|
||||
sniffer.traffic_chart.color_outgoing,
|
||||
to_rgb_color(get_colors(StyleType::DeepSea).outgoing)
|
||||
);
|
||||
assert_eq!(
|
||||
sniffer.traffic_chart.color_incoming,
|
||||
to_rgb_color(get_colors(StyleType::DeepSea).secondary)
|
||||
);
|
||||
assert_eq!(
|
||||
sniffer.traffic_chart.color_mix,
|
||||
get_color_mix_chart(StyleType::DeepSea)
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue