Exemplo n.º 1
0
        public void ToString_Returns_Value()
        {
            const string VALUE = "this is a value";

            // arrange
            var dto = new ValueIdentifier()
            {
                Value = VALUE
            };

            // act
            var result = dto.ToString();

            // assert
            Assert.Equal(VALUE, result);
        }
Exemplo n.º 2
0
        public override string ToString()
        {
            var sb = new StringBuilder();

            if (ValueIdentifier == null)
            {
                sb.Append($"for {KeyIdentifier.ToString()}");
            }
            else
            {
                sb.Append($"for {KeyIdentifier.ToString()}, {ValueIdentifier.ToString()}");
            }

            sb.Append($" in {Collection.ToString()} {{\n{Body.ToString()}\n}}");

            return(sb.ToString());
        }