Skip to content

Commit

Permalink
Inverted the logic - don't know how I did that. Anyway, fixed now. An…
Browse files Browse the repository at this point in the history
…d added a test.
  • Loading branch information
eamonnmag committed Jan 20, 2014
1 parent 0aa79bb commit bedae16
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,10 @@ public Pair<Boolean, OrderedMap<String, OrderedMap<InvestigationFileSection, Ord


String valueToTitleCase = lineLabel;
if (!lineLabel.contains("Comment"))
if (lineLabel.contains("Comment"))
valueToTitleCase = StringProcessing.removeSpaceFromQualifiedField(StringProcessing.convertStringToTitleCase(lineLabel));

System.out.println(valueToTitleCase);
if (!importedInvestigationFile.get(currentMajorSection).get(currentMinorSection).containsKey(valueToTitleCase)) {
importedInvestigationFile.get(currentMajorSection).get(currentMinorSection).put(valueToTitleCase, new ArrayList<String>());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package org.isatools.isacreator.utils;

import org.junit.Test;

import static junit.framework.Assert.assertEquals;

/**
* Created with IntelliJ IDEA.
* User: eamonnmaguire
* Date: 20/01/2014
* Time: 13:41
* To change this template use File | Settings | File Templates.
*/
public class StringProcessingTest {

@Test
public void testSpaceRemovalInQualifier() {
String comment = "Comment [Technical Validation]";
comment = StringProcessing.removeSpaceFromQualifiedField(comment);
System.out.println(comment);
assertEquals("Comment should have no spaces...", comment, "Comment[Technical Validation]");
}
}

0 comments on commit bedae16

Please sign in to comment.