public void TestMethodSaleItenParsePrice() { string lineInput = "1-44-22.22"; decimal priveValue = 22.22M; var resultItem = SaleIten.Parse(lineInput); SaleIten ff = resultItem[0]; Assert.AreEqual(priveValue, ff.Price); }
public static Sales Parse(string line) { string[] splitedLine = line.Split(Configuration.lineSeparator); Sales sale = null; if (splitedLine.Length == 4) { sale = new Sales(); sale.Id = Convert.ToInt32(splitedLine[1]); sale.Itens = SaleIten.Parse(splitedLine[2]); sale.SalesName = splitedLine[3]; } return(sale); }