tests: add test for TrelloBoards::find_by_name()
This commit is contained in:
parent
20e3c80da2
commit
e45c5a6ef8
2 changed files with 34 additions and 1 deletions
|
@ -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));
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
},
|
||||
|
|
Loading…
Add table
Reference in a new issue