public void Concat_ArrayObj_Test() { var info = new object[] { 1, 2, 3, 4 }; var concatResult = AElfString.Concat(info); concatResult.ShouldBe("1234"); }
public void Concat_StringParameters_Test() { var info1 = "test1"; var info2 = "test2"; var info3 = "test3"; var info4 = "test4"; var result1 = AElfString.Concat(info1, info2); result1.ShouldBe("test1test2"); var result2 = AElfString.Concat(info1, info2, info3); result2.ShouldBe("test1test2test3"); var result3 = AElfString.Concat(info1, info2, info3, info4); result3.ShouldBe("test1test2test3test4"); #if !DEBUG var result4 = result3; while (result4.Length < SmartContractConstants.AElfStringLengthLimitInContract) { result4 = result4 + info1; } Assert.Throws <AssertionException>(() => { AElfString.Concat(result4, result1); }); #endif }
public void Concat_ArrayString_Test() { var array = new[] { "test1", "test2", "test3", "test4" }; var concatResult = AElfString.Concat(array); var emptyInfo = string.Empty; concatResult.ShouldBe(string.Join(emptyInfo, array)); }
public void Concat_StringParameters_Test() { var info1 = "test1"; var info2 = "test2"; var info3 = "test3"; var result1 = AElfString.Concat(info1, info2); result1.ShouldBe("test1test2"); var result2 = AElfString.Concat(info1, info2, info3); result2.ShouldBe("test1test2test3"); }
public void Concat_ObjectParameters_Test() { object info1 = 24; object info2 = "test"; object info3 = Hash.Empty; object info4 = new[] { 2, 4, 6 }; var result1 = AElfString.Concat(info1, info2); result1.ShouldBe("24test"); var result2 = AElfString.Concat(info1, info2, info3); result2.ShouldBe("24test" + info3); var result3 = AElfString.Concat(info1, info2, info3, info4); result3.ShouldBe("24test" + info3 + info4); }