Esempio n. 1
0
 static void Main(string[] args)
 {
     string s="assaz";
     string g = "agjkgkg";
     Console.WriteLine(StringConcatenation.Concate(s,g));
     Console.ReadKey();
 }
Esempio n. 2
0
 private static void PrototypeExample()
 {
     StringConcatenation.UsingThePlusOperator();
     StringConcatenation.UsingTheStringBuilder();
     StringConcatenation.PrintTimeDifference();
     //var prototype = new ConcretePrototype("Clone 1");
     //var clone = (ConcretePrototype)prototype.Clone();
     //Console.WriteLine($"Clone Id: {clone.Id}");
 }
Esempio n. 3
0
        static void Main(string[] args)
        {
            var concat = new StringConcatenation("qwejluhabcdefjrt", "ytrewqqqq");
            var str    = concat.Concatenation();

            if (str != null)
            {
                Console.WriteLine(str);
            }
            Console.ReadKey();
        }
Esempio n. 4
0
        public void StringConcatenates()
        {
            // Baby steps towards useful unit tests
            var sc = new StringConcatenation(null, new [] { new StringLiteral("hello, "), new StringLiteral("world!"), });

            sc = new StringConcatenation(null, new Expression[] {
                new StringLiteral("hello, "),
                new StaticGet("dart"),
                new StringLiteral("!"),
            });
            sc.ToExpressionSyntax().ToString().ShouldBe("$\"hello, {dart}!\"");
        }
Esempio n. 5
0
        public static IPart Concat(IPart part, params IPart[] parts)
        {
            if (parts.Length == 0)
            {
                return(part);
            }

            if (parts.Length == 1)
            {
                return(new StringConcatenation(part, parts[0]));
            }

            var result = new StringConcatenation(part, parts[0]);

            for (var i = 1; i < parts.Length; i++)
            {
                result = new StringConcatenation(result, parts[i]);
            }

            return(result);
        }
Esempio n. 6
0
 public void Visit(StringConcatenation sc) => HandleOperation(sc.Left, sc.Right, "|| ");
Esempio n. 7
0
 public void Concatenation_Second_String_IsNull_ArgumentNullException()
 => Assert.Throws(typeof(ArgumentNullException), () => StringConcatenation.Concatenation("ss", null));
Esempio n. 8
0
 public void Concatenation_First_String_IsNull_ArgumentNullException()
 => Assert.Throws(typeof(ArgumentNullException), () => StringConcatenation.Concatenation(null, "ss"));
Esempio n. 9
0
 public void Concatenation_Second_String_IsNotValid_ArgumentException()
 => Assert.Throws(typeof(ArgumentException), () => StringConcatenation.Concatenation("ss", "ss111"));
Esempio n. 10
0
 public string Concatenation_ValidData_ValidResult(string first, string second)
 => StringConcatenation.Concatenation(first, second);
Esempio n. 11
0
 internal protected virtual T Visit(StringConcatenation node)
 {
     return(Visit(node as Expression));
 }
Esempio n. 12
0
 protected override EP_VP1 Visit(StringConcatenation node)
 {
     return(Visit(node as Expression));
 }