diff --git a/src/trello/tests/board/mod.rs b/src/trello/tests/board/mod.rs index 2563f63..bffc408 100644 --- a/src/trello/tests/board/mod.rs +++ b/src/trello/tests/board/mod.rs @@ -2,3 +2,33 @@ use super::*; mod get; + +#[test] +fn when_board_is_in_list_find_succeeds() { + //given + let board_name: TrelloBoardName = s!("name-1").into(); + let board = TrelloBoard { + id: s!("id-1").into(), + name: board_name.clone(), + lists: vec![], + }; + let boards = vec![ + TrelloBoard { + id: s!("id-2").into(), + name: s!("name-2").into(), + lists: vec![], + }, + board.clone(), + TrelloBoard { + id: s!("id-3").into(), + name: s!("name-3").into(), + lists: vec![], + }, + ]; + + //when + let result = boards.find_by_name(&board_name); + + //then + assert_eq!(result, Some(&board)); +} diff --git a/src/trello/tests/mod.rs b/src/trello/tests/mod.rs index bb87df8..2b2aa09 100644 --- a/src/trello/tests/mod.rs +++ b/src/trello/tests/mod.rs @@ -18,7 +18,10 @@ use crate::{ board::TrelloBoardCommand, card::TrelloCardCommand, member::TrelloMemberCommand, - model::{TrelloBoardId, TrelloCardId}, + model::{ + board::{TrelloBoard, TrelloBoards}, + TrelloBoardId, TrelloBoardName, TrelloCardId, + }, stack::TrelloStackCommand, TrelloCommand, TrelloConfig, },