Skip to content
Snippets Groups Projects
Commit c45128e0 authored by abhqy's avatar abhqy
Browse files

Added unit test for testing model classes

parent 72ef8eb2
No related branches found
No related tags found
1 merge request!3Constructor
Pipeline #83302 passed
......@@ -3,12 +3,39 @@
*/
package notes.multi.app
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.Assertions.assertEquals
import notes.multi.utilities.Note
import notes.multi.utilities.Folder
import java.time.LocalDate
import java.time.LocalDateTime
class MessageUtilsTest {
@Test fun testGetMessage() {
assertEquals("Hello World!", MessageUtils.getMessage())
}
@Test fun checkModelClasses() {
var n = Note(
title = "NeverGonnaGiveYouUp",
text = StringBuffer(""),
author = "Rick Astley",
extension = "txt",
lastModified = LocalDateTime.now(),
location = "."
)
var fldr = Folder(
title = "Test Folder",
description = "This folder is a test",
author = "Jeff Avery",
dateCreated = LocalDate.now(),
lastModified = null,
notes = mutableListOf<Note>(n)
)
assertEquals(fldr.notes?.get(0) ?: null, n)
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment