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

Add JUnit test for Day007.class #181

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
eebbd0e
third party libs used in Day 21
Viniberaldo Oct 20, 2022
9b77da9
third party libs used in Day 29
Viniberaldo Oct 20, 2022
b88e9ae
third party libs used in Day 55
Viniberaldo Oct 20, 2022
ebc234d
third party libs used in Day 57
Viniberaldo Oct 20, 2022
c2a688d
broken link fix in Day 61
Viniberaldo Oct 20, 2022
46115e6
third party libs used in Day 63
Viniberaldo Oct 20, 2022
60d6550
third party libs used in Day 66
Viniberaldo Oct 20, 2022
2f73e35
third party libs used in Day 70
Viniberaldo Oct 20, 2022
33e696d
third party libs used in Day 83
Viniberaldo Oct 20, 2022
ec3af1c
third party libs used in Day 84
Viniberaldo Oct 21, 2022
aa47ff0
third party libs used in Day 85
Viniberaldo Oct 21, 2022
1818b39
third party libs used in Day 95
Viniberaldo Oct 21, 2022
4d5f561
third party libs used in Day 97
Viniberaldo Oct 21, 2022
90c0100
typos fix
Viniberaldo Oct 24, 2022
88c3214
Microprofile project website correction
Viniberaldo Oct 24, 2022
d220014
Microprofile website correction
Viniberaldo Oct 24, 2022
4367504
Microprofile website correction
Viniberaldo Oct 24, 2022
4d82114
Microprofile website correction
Viniberaldo Oct 24, 2022
7ffef63
Merge branch 'hbelmiro:main' into main
Viniberaldo Sep 29, 2024
df1d1f5
Created JUnit tests for Day007.class
Viniberaldo Sep 29, 2024
0b189bc
Created JUnit tests for Day007.class
Viniberaldo Sep 29, 2024
dabd05f
Code review adjusts in Day007Test
Viniberaldo Sep 29, 2024
8a5d831
Code review adjusts in Day007Test
Viniberaldo Sep 29, 2024
44031ad
final version of Day007Test after code review adjusts
Viniberaldo Sep 29, 2024
5412517
This pull request introduces a new JUnit test class (Day007Test.java)…
Viniberaldo Sep 29, 2024
c925dca
This pull request introduces a new JUnit test class (Day007Test.java)…
Viniberaldo Oct 1, 2024
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
12 changes: 12 additions & 0 deletions days/day007/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,17 @@

<artifactId>day007</artifactId>

<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

</project>
Viniberaldo marked this conversation as resolved.
Show resolved Hide resolved

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package com.thegreatapi.ahundreddaysofjava.day007;

import java.text.MessageFormat;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.jupiter.api.Test;

class Day007Test {

@Test
void shouldFormatMessageCorrectly() {
// Arrange
String param1 = "Hello";
String param2 = "World";
String param3 = "Java";

// Act
String actualMessage = MessageFormat.format(
"This message contains 3 parameters. The #1 is ''{0}'', "
+ "the #2 is ''{1}'', and the #3 is ''{2}''.",
param1, param2, param3);

// Assert
String expectedMessage = "This message contains 3 parameters. The #1 is"
+ " 'Hello', the #2 is 'World', and the #3 is 'Java'.";
assertThat(actualMessage).isEqualTo(expectedMessage);
}

}