1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
use crate::company;
use crate::data::job;
use crate::misc;

pub struct Info {
    company: String,
    title: String,
    descriptor: String,
    level: String,
}

pub fn info() -> Info {
    Info {
        company: company::company(),
        title: title(),
        descriptor: descriptor(),
        level: level(),
    }
}

pub fn title() -> String {
    misc::random_data(job::TITLE).to_string()
}

pub fn descriptor() -> String {
    misc::random_data(job::DESCRIPTOR).to_string()
}

pub fn level() -> String {
    misc::random_data(job::LEVEL).to_string()
}

#[cfg(test)]
mod tests {
    use crate::job;
    use crate::testify::exec_mes;

    #[test]
    fn title() {
        exec_mes("job::title", || job::title());
    }

    #[test]
    fn descriptor() {
        exec_mes("job::descriptor", || job::descriptor());
    }

    #[test]
    fn level() {
        exec_mes("job::level", || job::level());
    }
}