public void CanStringJoinArrayOfStringsWithCommaSeparator() { var seq = new[] { "um", "dois", "três" }; var str = seq.StringJoin(","); str.Should().Be("um,dois,três"); }
public void CanStringJoinArrayOfIntsWithCommaSeparator() { var seq = new[] { 1, 2, 3 }; var str = seq.StringJoin(","); str.Should().Be("1,2,3"); }
public void CanStringJoinArrayOfStrings() { var seq = new[] { "um", "dois", "três" }; var str = seq.StringJoin(); str.Should().Be("umdoistrês"); }
public void ValidateStringJoinForEtcString() { string expectedSequence = utilityObj.xmlUtil.GetTextValue( Constants.IEnumerableExtensionsNode, Constants.ExpectedSequence); string etcString = utilityObj.xmlUtil.GetTextValue( Constants.IEnumerableExtensionsNode, Constants.EtcStringNode); int maxLength = Convert.ToInt32(utilityObj.xmlUtil.GetTextValue( Constants.IEnumerableExtensionsNode, Constants.MaxAttemptString), CultureInfo.InvariantCulture); sequences = utilityObj.xmlUtil.GetTextValue(Constants.IEnumerableExtensionsNode, Constants.Sequence2).Split(';'); IEnumerable<string> enumerable = new[] { sequences[0], sequences[1], sequences[2], null }; string join = enumerable.StringJoin(":", maxLength, etcString); Assert.IsNotNull(join); Assert.AreEqual(expectedSequence, join); ApplicationLog.WriteLine("IEnumerableExtensions BVT: Validation of StringJoin method for sequences, separator, length and etc-string completed successfully."); }