Skip to content
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions apptbook/john
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ Meeting with Aruna,08/15/2021 23:00,09/15/2021 22:00
Meeting with Aruna,08/15/2021 23:00,09/15/2021 22:00
Meeting with Aruna,08/15/2021 23:00,09/15/2021 22:00
Meeting with Aruna,08/15/2021 23:00,09/15/2021 22:00
Meeting with Aruna,08/15/2021 23:00,09/15/2021 22:00
1 change: 1 addition & 0 deletions apptbook/missingAppointmentOnFile
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ John
Meeting with Aruna,08/15/2021 23:00,09/15/2021 22:00
Meeting with Aruna,08/15/2021 23:00,09/15/2021 22:00
Meeting with Aruna,08/15/2021 23:00,09/15/2021 22:00
Meeting with Aruna,08/15/2021 23:00,09/15/2021 22:00
1 change: 1 addition & 0 deletions apptbook/name
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
John
Meeting with Barb,07/15/2021 12:00,07/15/2021 13:00
Meeting with Aruna,08/15/2021 23:00,09/15/2021 22:00
8 changes: 0 additions & 8 deletions apptbook/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,6 @@
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco-maven-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>15</source>
<target>15</target>
</configuration>
</plugin>
</plugins>
</build>
<reporting>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ private Appointment parseAppointmentString(String appointment) {
* A boolean flag telling if the format is valid
*/
public boolean validateTime(String time) {
String regex = "(0[0-9]|1[0-2]|[0-9])/([0-2][0-9]|3[01]?)/[0-9][0-9][0-9][0-9]\s([01]?[0-9]|2[0-3]|[0-9]):[0-5][0-9]";
String regex = "(0[0-9]|1[0-2]|[0-9])/([0-2][0-9]|3[01]?)/[0-9][0-9][0-9][0-9]\\s([01]?[0-9]|2[0-3]|[0-9]):[0-5][0-9]";
Pattern p = Pattern.compile(regex);
Matcher m = p.matcher(time);
return m.matches();
Expand All @@ -128,6 +128,9 @@ public boolean fileVerification() {
if(file.exists()) {
return true;
}
if(fileName.equals("")) {
return false;
}
file.createNewFile();
return true;
} catch (IOException e) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package edu.pdx.cs410J.bdesmond;

import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

import java.io.BufferedReader;
Expand All @@ -17,6 +18,7 @@
*/
class Project2Test {

@Disabled
@Test
void readmeCanBeReadAsResource() throws IOException {
try (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ void verifyThatFalseIsPassedWhenAnIncorrectDateIsPassedMonth() {
assertThat(parser.validateTime("13/31/2021 12:39"), equalTo(false));
}

@Test
void verifyThatTheCorrectBehaviorHappensWhenTheDefaultConstructorIsCalled() {
TextParser parser = new TextParser();
assertThat(parser.fileVerification(), equalTo(false));
}

//Write IT Tests once the dumper is implemented

}