Skip to content
Snippets Groups Projects
Commit 9a638944 authored by Abhay Menon's avatar Abhay Menon
Browse files

Merge branch 'Classes' into 'main'

Constructor

See merge request !3
parents cf560f7e c45128e0
No related branches found
No related tags found
1 merge request!3Constructor
Pipeline #83364 passed with stages
in 2 minutes and 59 seconds
......@@ -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)
}
}
package notes.multi.utilities
import java.time.LocalDate
import java.time.LocalDateTime
class Folder(var title: String = "Untitled",
var description: String = "Empty",
val author: String = "?", // User class?
val dateCreated: LocalDate? = LocalDate.now(),
var lastModified: LocalDateTime? = LocalDateTime.now(),
var notes: MutableList<Note>? = null) {
// add/remove notes
// update last modified
}
\ No newline at end of file
package notes.multi.utilities
import java.time.LocalDate
import java.time.LocalDateTime
class Note(var title: String = "Untitled",
var text: StringBuffer = StringBuffer(""),
val author: String = "?", // User class?
var extension: String= "?", // necessary?
val dateCreated: LocalDate? = LocalDate.now(),
var lastModified: LocalDateTime? = LocalDateTime.now(),
var location: String? = null) { // path to the created file?
// update last modified date
// images?
}
\ No newline at end of file
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