Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

assertEquals converted to assertThat for MarkdownTest #2202

Merged
merged 1 commit into from
Nov 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions exercises/practice/markdown/src/test/java/MarkdownTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import org.junit.Ignore;
import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.assertj.core.api.Assertions.assertThat;

public class MarkdownTest {

Expand All @@ -18,7 +18,7 @@ public void normalTextAsAParagraph() {
String input = "This will be a paragraph";
String expected = "<p>This will be a paragraph</p>";

assertEquals(expected, markdown.parse(input));
assertThat(markdown.parse(input)).isEqualTo(expected);
}

@Ignore("Remove to run test")
Expand All @@ -27,7 +27,7 @@ public void italics() {
String input = "_This will be italic_";
String expected = "<p><em>This will be italic</em></p>";

assertEquals(expected, markdown.parse(input));
assertThat(markdown.parse(input)).isEqualTo(expected);
}

@Ignore("Remove to run test")
Expand All @@ -36,7 +36,7 @@ public void boldText() {
String input = "__This will be bold__";
String expected = "<p><strong>This will be bold</strong></p>";

assertEquals(expected, markdown.parse(input));
assertThat(markdown.parse(input)).isEqualTo(expected);
}

@Ignore("Remove to run test")
Expand All @@ -45,7 +45,7 @@ public void normalItalicsAndBoldText() {
String input = "This will _be_ __mixed__";
String expected = "<p>This will <em>be</em> <strong>mixed</strong></p>";

assertEquals(expected, markdown.parse(input));
assertThat(markdown.parse(input)).isEqualTo(expected);
}

@Ignore("Remove to run test")
Expand All @@ -54,7 +54,7 @@ public void withH1HeaderLevel() {
String input = "# This will be an h1";
String expected = "<h1>This will be an h1</h1>";

assertEquals(expected, markdown.parse(input));
assertThat(markdown.parse(input)).isEqualTo(expected);
}

@Ignore("Remove to run test")
Expand All @@ -63,7 +63,7 @@ public void withH2HeaderLevel() {
String input = "## This will be an h2";
String expected = "<h2>This will be an h2</h2>";

assertEquals(expected, markdown.parse(input));
assertThat(markdown.parse(input)).isEqualTo(expected);
}

@Ignore("Remove to run test")
Expand All @@ -72,7 +72,7 @@ public void withH6HeaderLevel() {
String input = "###### This will be an h6";
String expected = "<h6>This will be an h6</h6>";

assertEquals(expected, markdown.parse(input));
assertThat(markdown.parse(input)).isEqualTo(expected);
}

@Ignore("Remove to run test")
Expand All @@ -81,7 +81,7 @@ public void unorderedLists() {
String input = "* Item 1\n* Item 2";
String expected = "<ul><li>Item 1</li><li>Item 2</li></ul>";

assertEquals(expected, markdown.parse(input));
assertThat(markdown.parse(input)).isEqualTo(expected);
}

@Ignore("Remove to run test")
Expand All @@ -90,7 +90,7 @@ public void aLittleBitOfEverything() {
String input = "# Header!\n* __Bold Item__\n* _Italic Item_";
String expected = "<h1>Header!</h1><ul><li><strong>Bold Item</strong></li><li><em>Italic Item</em></li></ul>";

assertEquals(expected, markdown.parse(input));
assertThat(markdown.parse(input)).isEqualTo(expected);
}

@Ignore("Remove to run test")
Expand All @@ -99,7 +99,7 @@ public void markdownSymbolsInTheHeaderShouldNotBeInterpreted() {
String input = "# This is a header with # and * in the text";
String expected = "<h1>This is a header with # and * in the text</h1>";

assertEquals(expected, markdown.parse(input));
assertThat(markdown.parse(input)).isEqualTo(expected);
}

@Ignore("Remove to run test")
Expand All @@ -108,7 +108,7 @@ public void markdownSymbolsInTheListItemTextShouldNotBeInterpreted() {
String input = "* Item 1 with a # in the text\n* Item 2 with * in the text";
String expected = "<ul><li>Item 1 with a # in the text</li><li>Item 2 with * in the text</li></ul>";

assertEquals(expected, markdown.parse(input));
assertThat(markdown.parse(input)).isEqualTo(expected);
}

@Ignore("Remove to run test")
Expand All @@ -117,7 +117,7 @@ public void markdownSymbolsInTheParagraphTextShouldNotBeInterpreted() {
String input = "This is a paragraph with # and * in the text";
String expected = "<p>This is a paragraph with # and * in the text</p>";

assertEquals(expected, markdown.parse(input));
assertThat(markdown.parse(input)).isEqualTo(expected);
}

@Ignore("Remove to run test")
Expand All @@ -126,7 +126,7 @@ public void markdownUnorderedListsCloseProperlyWithPrecedingAndFollowingLines()
String input = "# Start a list\n* Item 1\n* Item 2\nEnd a list";
String expected = "<h1>Start a list</h1><ul><li>Item 1</li><li>Item 2</li></ul><p>End a list</p>";

assertEquals(expected, markdown.parse(input));
assertThat(markdown.parse(input)).isEqualTo(expected);
}

}