2021-07-17 08:24:17 +08:00
|
|
|
pub mod builder;
|
2021-07-16 23:18:12 +08:00
|
|
|
mod helper;
|
2021-09-04 15:12:53 +08:00
|
|
|
// pub mod workspace_builder;
|
2021-07-16 23:18:12 +08:00
|
|
|
|
2021-09-04 15:12:53 +08:00
|
|
|
use crate::{builder::UserTestBuilder, helper::root_dir};
|
2021-08-20 14:38:03 +08:00
|
|
|
use flowy_sdk::FlowySDK;
|
2021-07-06 14:14:47 +08:00
|
|
|
|
|
|
|
pub mod prelude {
|
2021-09-04 15:12:53 +08:00
|
|
|
pub use crate::{builder::*, helper::*, *};
|
2021-07-08 21:23:44 +08:00
|
|
|
pub use flowy_dispatch::prelude::*;
|
2021-07-06 14:14:47 +08:00
|
|
|
}
|
|
|
|
|
2021-09-04 15:12:53 +08:00
|
|
|
pub type FlowyTestSDK = FlowySDK;
|
|
|
|
|
|
|
|
#[derive(Clone)]
|
|
|
|
pub struct TestSDKBuilder {
|
|
|
|
inner: FlowyTestSDK,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl TestSDKBuilder {
|
|
|
|
pub fn new() -> Self { Self { inner: init_test_sdk() } }
|
2021-07-06 14:14:47 +08:00
|
|
|
|
2021-09-04 15:12:53 +08:00
|
|
|
pub fn sign_up(self) -> Self {
|
|
|
|
let _ = UserTestBuilder::new(self.inner.clone()).sign_up();
|
|
|
|
self
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn build(self) -> FlowyTestSDK { self.inner }
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn init_test_sdk() -> FlowyTestSDK {
|
|
|
|
let root_dir = root_dir();
|
|
|
|
FlowySDK::new(&root_dir)
|
2021-07-06 14:14:47 +08:00
|
|
|
}
|