Skip to content

Commit 368c625

Browse files
committed
Adding Tests for Account Creation - So Far Three of the Four Work
1 parent 3bd474b commit 368c625

File tree

2 files changed

+26
-18
lines changed

2 files changed

+26
-18
lines changed

CRO/tests/prove.t6

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,29 @@
1-
use lib '.'; #Tells Perl6 to Search in the Current Directory
2-
use tools; #The Module we created in tools.pm6 (unit module)
3-
use Test; #Test Module to perform tests
1+
use lib '.';
2+
use sign-in;
3+
use Test;
44

5-
#Declare the amount of tests that you plan one running. If you don't do this the test fails.
6-
plan 1;
5+
#Plan
6+
plan 4;
77

8-
#Avg is the function we called in tools.pm6
9-
my $result = avg(2,4);
8+
###########################################
9+
#####Tests for Verification of Account#####
10+
###########################################
1011

11-
#Checks if the result is equal to the average of 2 and 4 and the test passes since result equals 3
12-
ok($result eq 3, 'CORRECT');
12+
#Working Test
13+
my $account-made = account-made("Hello", "test@test.com", "secret");
14+
ok($account-made = 1, 'Account Made');
15+
16+
#Missing Value | Error Message is Long and Dumb
17+
my $account-missing = account-made("Hello", Nil, "secret");
18+
ok($account-missing = "DBDish::SQLite: Error: UNIQUE constraint failed: accounts.username (19)
19+
in method execute at /usr/local/Cellar/rakudo-star/2019.03/share/perl6/site/sources/DE559529B32B6D348188B437156092A03C0433A1 (DBDish::SQLite::StatementHandle) line 45
20+
in sub account-made at /Users/1013042/Repos/ingredient.guru/CRO/tests/sign-in.pm6 (sign-in) line 37
21+
in block <unit> at prove.t6 line 18", 'Value Missing');
22+
23+
#Correct Info | Email Correct
24+
my $account-email = email-valid("test@test.com");
25+
ok($account-email = True, 'Email Correct');
26+
27+
#Incorrect Info | Email Incorrect
28+
#my $account-email-inc = email-valid("d");
29+
#ok($account-email-inc = False, 'Email Incorrect');

CRO/tests/tools.pm6

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)