Struct retdec::test::Test [] [src]

pub struct Test { /* fields omitted */ }

Testing service.

Methods

impl Test
[src]

Creates a new instance of the testing service.

Tries to authenticate to the retdec.com's API.

Returns Ok(()) when the authentication succeeds. Otherwise, it returns an error.

Examples

use retdec::settings::Settings;
use retdec::test::Test;

let settings = Settings::new()
    .with_api_key("MY-API-KEY");
let test = Test::new(settings);
test.auth()?;

Echoes back the given parameters (key-value pairs).

Examples

use std::collections::HashMap;
use retdec::settings::Settings;
use retdec::test::Test;

let settings = Settings::new()
    .with_api_key("MY-API-KEY");
let test = Test::new(settings);
let mut params = HashMap::new();
params.insert("param1".to_string(), "value1".to_string());
params.insert("param2".to_string(), "value2".to_string());
let result = test.echo(&params)?;
assert_eq!(result.get("param1"), Some(&"value1".to_string()));
assert_eq!(result.get("param2"), Some(&"value2".to_string()));