Skip to content

Commit

Permalink
Add tests for v14 and mixed builder
Browse files Browse the repository at this point in the history
  • Loading branch information
rnestler committed Nov 14, 2020
1 parent 30c3a65 commit 79d1d61
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions src/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,48 @@ mod test {
assert_eq!(a, b);
}

#[test]
fn test_builder_v14() {
let status = StatusBuilder::v14("foo")
.logo("bar")
.url("foobar")
.location(Location::default())
.contact(Contact::default())
.add_issue_report_channel(IssueReportChannel::Email)
.build()
.unwrap();
assert_eq!(status, Status{
api: None,
api_compatibility: Some(vec![ApiVersion::V14]),
space: "foo".into(),
logo: "bar".into(),
url: "foobar".into(),
issue_report_channels: vec![IssueReportChannel::Email],
..Status::default()
});
}

#[test]
fn test_builder_mixed() {
let status = StatusBuilder::mixed("foo")
.logo("bar")
.url("foobar")
.location(Location::default())
.contact(Contact::default())
.add_issue_report_channel(IssueReportChannel::Email)
.build()
.unwrap();
assert_eq!(status, Status{
api: Some("0.13".into()),
api_compatibility: Some(vec![ApiVersion::V14]),
space: "foo".into(),
logo: "bar".into(),
url: "foobar".into(),
issue_report_channels: vec![IssueReportChannel::Email],
..Status::default()
});
}

#[test]
fn test_builder() {
let status = StatusBuilder::new("foo")
Expand Down

0 comments on commit 79d1d61

Please sign in to comment.