public void FromRecord_WithValidString_Writes(string entry) { var item = new GildedRoseAssignment.StockItem(); item.FromRecord(entry); entry.Trim(); string[] words = entry.Split(' '); string namestring = ""; for (int i = 0; i < words.Length - 3; i++) { namestring += words[i] + ' '; } namestring += words[words.Length - 3]; Assert.AreEqual(namestring, item.Name); Assert.AreEqual(1, item.SellIn); Assert.AreEqual(1, item.Quality.Value); }
public SingleDataWriter(StockItem item) { theItem = item; }
public static string ToRecord(this StockItem item) { string result = item.Name += ' ' + item.SellIn.ToString() + ' ' + item.Quality.Value.ToString(); return(result); }
public void Transform(StockItem item) { item.IsValid = false; }
public SingleDataReader(StockItem item) { theItem = item; }
public void Transform(StockItem item) { // INTENTIONALLY DOES NOTHING }