static void Main(string[] args) { string s="assaz"; string g = "agjkgkg"; Console.WriteLine(StringConcatenation.Concate(s,g)); Console.ReadKey(); }
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}"); }
static void Main(string[] args) { var concat = new StringConcatenation("qwejluhabcdefjrt", "ytrewqqqq"); var str = concat.Concatenation(); if (str != null) { Console.WriteLine(str); } Console.ReadKey(); }
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}!\""); }
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); }
public void Visit(StringConcatenation sc) => HandleOperation(sc.Left, sc.Right, "|| ");
public void Concatenation_Second_String_IsNull_ArgumentNullException() => Assert.Throws(typeof(ArgumentNullException), () => StringConcatenation.Concatenation("ss", null));
public void Concatenation_First_String_IsNull_ArgumentNullException() => Assert.Throws(typeof(ArgumentNullException), () => StringConcatenation.Concatenation(null, "ss"));
public void Concatenation_Second_String_IsNotValid_ArgumentException() => Assert.Throws(typeof(ArgumentException), () => StringConcatenation.Concatenation("ss", "ss111"));
public string Concatenation_ValidData_ValidResult(string first, string second) => StringConcatenation.Concatenation(first, second);
internal protected virtual T Visit(StringConcatenation node) { return(Visit(node as Expression)); }
protected override EP_VP1 Visit(StringConcatenation node) { return(Visit(node as Expression)); }