mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-15 14:31:28 +00:00
Update gildedrose.rs
Add ability to assert equality on items and modify first starter test to do so.
This commit is contained in:
parent
2e30c563d8
commit
de03cc8f52
@ -1,4 +1,6 @@
|
|||||||
use std::fmt::{self, Display};
|
use std::fmt::{self, Display};
|
||||||
|
|
||||||
|
#[derive(Debug, PartialEq)]
|
||||||
pub struct Item {
|
pub struct Item {
|
||||||
pub name: String,
|
pub name: String,
|
||||||
pub sell_in: i32,
|
pub sell_in: i32,
|
||||||
@ -94,6 +96,6 @@ mod tests {
|
|||||||
let mut rose = GildedRose::new(items);
|
let mut rose = GildedRose::new(items);
|
||||||
rose.update_quality();
|
rose.update_quality();
|
||||||
|
|
||||||
assert_eq!("fixme", rose.items[0].name);
|
assert_eq!(rose.items[0], Item::new("fixme", -1, 0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user