Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+10 votes
asked in CSC 305 Fall 2024 by (4.9k points)

2 Answers

+4 votes
 
Best answer

It is a part of the JUnit framework.
Basically, assertion is simply your assumption about the results of the program you're testing. By using assertions or 'assertEquals' you put in the result you expect the program to have when running your test cases

answered by (3k points)
selected by
+4

Thank you for clarifying this for me!

+4 votes

I believe it is part of the unit test that asserts the answer you want. from our lab I found this: assertEquals("BCD", StringUtils.caesarCipher("ABC", 1));

the assertEquals is used to validate if the answer is correct or not, in this case its checking if the strings are equal

answered by (2k points)
+4

its also imported if this is helpful as well: import static org.junit.jupiter.api.Assertions.*;

+5

Thank you for the example. This is very helpful

...