public void TestFormat1() { decimal amount = 100.00m; _w.Write($"Price: {amount:000}"); Assert.AreEqual("Price: 100", _w.GetContents()); }
public void TestJoin() { _w.Write($@" I have a LOT of things to do today: {todoList.Select(item => $"- {item.Description}").Join()}"); string expected = @" I have a LOT of things to do today: - Get milk - Clean the house - Mow the lawn".TrimStart(Environment.NewLine.ToCharArray()); Assert.AreEqual(expected, _w.ToString()); }
public void TestIF_false_ENDIF() { _w.Write($@"WILL SHOW{IF(false)} WON'T SHOW{ENDIF}"); string expected = @"WILL SHOW"; Assert.AreEqual(expected, _w.GetContents()); }