예제 #1
0
        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());
        }
예제 #3
0
        public void TestIF_false_ENDIF()
        {
            _w.Write($@"WILL SHOW{IF(false)} WON'T SHOW{ENDIF}");

            string expected = @"WILL SHOW";

            Assert.AreEqual(expected, _w.GetContents());
        }