protected internal override void AddTypeSpecificDetails(StringJoiner joiner, GenericKey state) { joiner.add("long0=" + state.Long0); joiner.add("long1=" + state.Long1); joiner.add("long2=" + state.Long2); joiner.add("long3=" + state.Long3); }
public void ShouldConcateString() { StringJoiner sut = new StringJoiner(); string expected = "Usama Khan"; Assert.That(sut.Join("Usama", "Khan"), Is.EqualTo(expected)); }
public void ShouldConcateStringCasSenstive() { StringJoiner sut = new StringJoiner(); string expected = "USAMA KHAN"; Assert.That(sut.Join("Usama", "Khan"), Is.EqualTo(expected).IgnoreCase); }
public void ShouldJoinAndTestNotEqualString() { string expected = "Usama Khan"; StringJoiner sut = new StringJoiner(); Assert.That(sut.Join("MUhammad", "Usama"), Is.Not.EqualTo(expected)); }
private void ReportToJoiner(StringJoiner joiner, Counter counter) { if (counter.NbrOfReports > 0) { joiner.add(counter.ToString()); } }
public void TestJoinerClearClearsString() { var joiner = new StringJoiner(""); joiner.Append("a"); joiner.Clear(); Assert.AreEqual(string.Empty, joiner.ToString()); }
public override void RecoveryCleanupFinished(File indexFile, IndexDescriptor indexDescriptor, long numberOfPagesVisited, long numberOfCleanedCrashPointers, long durationMillis) { StringJoiner joiner = new StringJoiner(", ", "Schema index cleanup job finished: " + IndexDescription(indexFile, indexDescriptor) + " ", ""); joiner.add("Number of pages visited: " + numberOfPagesVisited); joiner.add("Number of cleaned crashed pointers: " + numberOfCleanedCrashPointers); joiner.add("Time spent: " + duration(durationMillis)); _log.info(joiner.ToString()); }
public void shouldJoinNotEqualString() { var sutStringJoiner = new StringJoiner(); string expectedResult = "USAMA KHAN"; var fullName = sutStringJoiner.Join("Muhammad", "Usama"); Assert.That(fullName, Is.Not.EqualTo(expectedResult).IgnoreCase); }
public void shouldJoinStringCaseInsentive() { var sutStringJoiner = new StringJoiner(); string expectedResult = "USAMA KHAN"; var fullName = sutStringJoiner.Join("Usama", "Khan"); Assert.That(fullName, Is.EqualTo(expectedResult).IgnoreCase); }
public void shouldJoinString() { var sutStringJoiner = new StringJoiner(); string expectedResult = "Usama Khan"; var fullName = sutStringJoiner.Join("Usama", "Khan"); Assert.That(fullName, Is.EqualTo(expectedResult)); }
protected internal override void AddTypeSpecificDetails(StringJoiner joiner, GenericKey state) { joiner.add("long1=" + state.Long1); joiner.add("long2=" + state.Long2); joiner.add("long3=" + state.Long3); joiner.add("long0Array=" + Arrays.ToString(state.Long0Array)); joiner.add("long1Array=" + Arrays.ToString(state.Long1Array)); base.AddTypeSpecificDetails(joiner, state); }
public void TestJoinerToStringGivesExpectedString(string seperator, string expected) { var joiner = new StringJoiner(seperator); joiner.Append("a"); joiner.Append("b"); joiner.Append("c"); Assert.AreEqual(expected, joiner.ToString()); }
public override string ToString() { StringJoiner joiner = new StringJoiner(", ", "CleanupJob(", ")"); joiner.add("file=" + _indexFile.AbsolutePath); joiner.add("needed=" + _needed); joiner.add("failure=" + (_failure == null ? null : _failure.ToString())); return(joiner.ToString()); }
public void ShouldCompareTwoStrings() { String expected = "USAMA KHAN"; StringJoiner sut = new StringJoiner(); sut.Join("Muhammad", "Usama"); Assert.That(sut.Result, Is.Not.EqualTo(expected)); }
public override void RecoveryCleanupFinished(long numberOfPagesVisited, long numberOfCleanedCrashPointers, long durationMillis) { StringJoiner joiner = new StringJoiner(", ", "Label index cleanup job finished: ", ""); joiner.add("Number of pages visited: " + numberOfPagesVisited); joiner.add("Number of cleaned crashed pointers: " + numberOfCleanedCrashPointers); joiner.add("Time spent: " + duration(durationMillis)); _log.info(joiner.ToString()); }
private string MainReportString(string title) { StringJoiner joiner = new StringJoiner(", ", title + ": ", ""); _times.Values.forEach(logger => { ReportToJoiner(joiner, logger); }); return(joiner.ToString()); }
private string IndexPattern(string label, params string[] properties) { StringJoiner pattern = new StringJoiner(",", ":" + label + "(", ")"); foreach (string property in properties) { pattern.add(property); } return(pattern.ToString()); }
internal override string ToDetailedStringInternal() { StringJoiner joiner = new StringJoiner(","); foreach (GenericKey state in _states) { joiner.add(state.ToDetailedStringInternal()); } return(joiner.ToString()); }
private string Join(ICollection <object> collection) { var joiner = new StringJoiner(","); foreach (var value in collection) { joiner.Add(value.ToString()); } return(joiner.ToString()); }
public string PrintGenreNames() { StringJoiner names = new StringJoiner(", "); foreach (var genre in Title.TitleGenre) { names.Join(genre.Genre.Name); } return(names.JoinedString); }
public override void Init() { _started = false; if (!_jobs.Empty) { StringJoiner joiner = new StringJoiner(string.Format("%n "), "Did not expect there to be any cleanup jobs still here. Jobs[", "]"); ConsumeAndCloseJobs(cj => joiner.add(_jobs.ToString())); throw new System.InvalidOperationException(joiner.ToString()); } ScheduleJobs(); }
private string PeriodReportString(long millisSinceLastPeriodReport) { long secondsSinceLastPeriodReport = TimeUnit.MILLISECONDS.toSeconds(millisSinceLastPeriodReport); StringJoiner joiner = new StringJoiner(", ", "Last " + secondsSinceLastPeriodReport + " sec: ", ""); //JAVA TO C# CONVERTER TODO TASK: Method reference arbitrary object instance method syntax is not converted by Java to C# Converter: _times.Values.Select(Logger::period).ForEach(period => { ReportToJoiner(joiner, period); period.reset(); }); return(joiner.ToString()); }
public static string SortGetExpectedPoints( BoundingBox bb, IList<SupportSpatialPoint> points) { var joiner = new StringJoiner(","); foreach (var point in points) { if (bb.ContainsPoint(point.Px.Value, point.Py.Value)) { joiner.Add(point.Id); } } return joiner.ToString(); }
private string Describe(ISet <KernelTransactionHandle> allBlockers) { if (allBlockers.Count == 0) { return(StringUtils.EMPTY); } StringJoiner stringJoiner = new StringJoiner(", ", "[", "]"); foreach (KernelTransactionHandle blocker in allBlockers) { stringJoiner.add(blocker.UserTransactionName); } return(stringJoiner.ToString()); }
internal virtual string ToDetailedString(GenericKey state) { StringJoiner joiner = new StringJoiner(", "); joiner.add(ToString(state)); // Mutable, meta-state joiner.add("type=" + state.TypeConflict.GetType().Name); joiner.add("inclusion=" + state.Inclusion); joiner.add("isArray=" + state.IsArray); AddTypeSpecificDetails(joiner, state); return(joiner.ToString()); }
private static void AssertCompare( MXCIFQuadTree tree, String expected, IDictionary <int, String> received) { StringJoiner joiner = new StringJoiner(","); foreach (string value in received.Values) { joiner.Add(value); } Assert.AreEqual(expected, joiner.ToString()); Assert.IsTrue((expected.Length == 0 ? 0 : expected.SplitCsv().Length) <= MXCIFQuadTreeFilterIndexCount.Count(tree)); }
internal virtual void AddToString(string name, long measurement, StringJoiner joiner, bool isTime) { string measurementString; if (isTime) { long timeInNanos = TimeUnit.MILLISECONDS.toNanos(measurement); measurementString = TimeUtil.nanosToString(timeInNanos); } else { measurementString = Convert.ToString(measurement); } joiner.add(string.Format("{0}={1}", name, measurementString)); }
/// <summary> /// Adds the contents of the given {@code StringJoiner} without prefix and /// suffix as the next element if it is non-empty. If the given {@code /// StringJoiner} is empty, the call has no effect. /// /// <para>A {@code StringJoiner} is empty if <seealso cref="#add(CharSequence) add()"/> /// has never been called, and if {@code merge()} has never been called /// with a non-empty {@code StringJoiner} argument. /// /// </para> /// <para>If the other {@code StringJoiner} is using a different delimiter, /// then elements from the other {@code StringJoiner} are concatenated with /// that delimiter and the result is appended to this {@code StringJoiner} /// as a single element. /// /// </para> /// </summary> /// <param name="other"> The {@code StringJoiner} whose contents should be merged /// into this one </param> /// <exception cref="NullPointerException"> if the other {@code StringJoiner} is null </exception> /// <returns> This {@code StringJoiner} </returns> public StringJoiner Merge(StringJoiner other) { Objects.RequireNonNull(other); if (other.Value != null) { //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final int length = other.value.length(); int length = other.Value.Length(); // lock the length so that we can seize the data to be appended // before initiate copying to avoid interference, especially when // merge 'this' StringBuilder builder = PrepareBuilder(); builder.Append(other.Value, other.Prefix.Length(), length); } return(this); }
/** * Makes the warning for when the registry responds with an image digest that is not the expected * digest of the image. * * @param expectedDigest the expected image digest * @param receivedDigests the received image digests * @return the warning message */ private static string MakeUnexpectedImageDigestWarning( DescriptorDigest expectedDigest, IList <string> receivedDigests) { if (receivedDigests.Count == 0) { return("Expected image digest " + expectedDigest + ", but received none"); } StringJoiner message = new StringJoiner(", ", "Expected image digest " + expectedDigest + ", but received: ", ""); foreach (string receivedDigest in receivedDigests) { message.Add(receivedDigest); } return(message.ToString()); }
internal virtual string BuildProcedureQuery() { StringJoiner stringJoiner = new StringJoiner(",", "CALL " + Name + "(", ")"); foreach (object parameter in Params) { stringJoiner.add(parameter.ToString()); } if (!string.ReferenceEquals(SetupQuery, null) && !string.ReferenceEquals(PostQuery, null)) { return(SetupQuery + " " + stringJoiner.ToString() + " " + PostQuery); } else { return(stringJoiner.ToString()); } }