#[macro_use]
extern crate serde_json;
mod common;

#[test]
#[allow(deprecated)]
fn insert_event() {
    let ditto = common::get_builder_ditto(None).unwrap();
    insert_event_impl(ditto);

    let ditto = common::get_revamp_ditto(None).unwrap();
    insert_event_impl(ditto);

    let ditto = common::get_revamp_ditto_async_sync(None).unwrap();
    insert_event_impl(ditto);
}

#[allow(deprecated)]
fn insert_event_impl(ditto: dittolive_ditto::prelude::Ditto) {
    use chrono::Utc;
    let store = ditto.store();
    let content = json!({"hello": "again"});
    let ts = store.timeseries("test").unwrap();
    let datetime = Utc::now();
    ts.insert(&datetime, content).unwrap();
}
