Skip to content

Commit

Permalink
Added implementation for Test
Browse files Browse the repository at this point in the history
  • Loading branch information
uglrl committed Aug 17, 2023
1 parent 65e0bbf commit 198956e
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions backend/tests/image_review.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
use mensa_app_backend::{
interface::image_review::ImageReviewScheduling,
layer::{
data::{
database::factory::DataAccessFactory, flickr_api::flickr_api_handler::FlickrApiHandler,
},
logic::image_review::image_reviewer::ImageReviewer,
},
startup::config::ConfigReader,
};

#[tokio::test]
#[ignore = "manual test "]
async fn test_start_image_review() {
let image_reviewer = setup().await;
image_reviewer.start_image_review().await;
}

async fn setup() -> impl ImageReviewScheduling {
let reader = ConfigReader::default();

let image_hoster = FlickrApiHandler::new(reader.read_flickr_info().unwrap());

let database_factory = DataAccessFactory::new(reader.read_database_info().unwrap(), false)
.await
.unwrap();
let data_access = database_factory.get_image_review_data_access();
ImageReviewer::new(data_access, image_hoster)
}

0 comments on commit 198956e

Please sign in to comment.