// 简单的编译测试文件
use super::frame_extractor::*;

#[cfg(test)]
mod compile_tests {
    use super::*;

    #[test]
    fn test_frame_type_serialization() {
        let frame_type = FrameType::First;
        let serialized = serde_json::to_string(&frame_type).unwrap();
        assert_eq!(serialized, "\"First\"");
    }

    #[test]
    fn test_image_format_serialization() {
        let format = ImageFormat::Jpg;
        let serialized = serde_json::to_string(&format).unwrap();
        assert_eq!(serialized, "\"Jpg\"");
    }

    #[test]
    fn test_video_file_info_creation() {
        let video_info = VideoFileInfo {
            path: "/test/video.mp4".to_string(),
            filename: "video.mp4".to_string(),
            size: 1024,
            duration: 60.0,
            width: 1920,
            height: 1080,
            fps: 30.0,
            format: "mp4".to_string(),
            is_valid: true,
            error_message: None,
        };

        assert_eq!(video_info.filename, "video.mp4");
        assert!(video_info.is_valid);
    }

    #[test]
    fn test_frame_extraction_config_creation() {
        let config = FrameExtractionConfig {
            frame_type: FrameType::First,
            time_points: None,
            custom_time: None,
            output_format: ImageQuality {
                format: ImageFormat::Jpg,
                quality: 85,
                compression_level: None,
            },
            output_size: None,
            output_directory: "/tmp".to_string(),
            filename_pattern: "{name}_{frame_type}".to_string(),
            overwrite_existing: false,
        };

        assert_eq!(config.output_format.quality, 85);
        assert_eq!(config.frame_type, FrameType::First);
    }
}
