You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test(`should return false when denominator is zero`,()=>{
9
9
expect(isProperFraction(1,0)).toEqual(false);
10
-
});
11
-
12
-
// Special case: numerator is zero (proper fraction)
13
-
test(`should return true when numerator is zero`,()=>{
14
-
expect(isProperFraction(0,1)).toEqual(true);
15
-
});
16
-
17
-
// Special case: both numerator and denominator are zeros (undefined)
18
-
test(`should return false when both numerator and denominator are zero`,()=>{
10
+
// Special case: both numerator and denominator are zeros (undefined)
19
11
expect(isProperFraction(0,0)).toEqual(false);
20
12
});
21
13
22
-
// case: both values are positive and the value of the numerater is less than the value of the denominater (proper fraction)
14
+
// Special case: numerator is zero (proper fraction)
23
15
test(`should return true for proper fraction`,()=>{
16
+
expect(isProperFraction(0,1)).toEqual(true);
17
+
// case: both values are positive and the value of the numerater is less than the value of the denominater (proper fraction)
24
18
expect(isProperFraction(1,2)).toEqual(true);
25
-
});
26
-
27
-
// case: both values are positive and the value of the denominater is less than the value of the numerater (improper fraction)
28
-
test(`should return false for improper fraction`,()=>{
29
-
expect(isProperFraction(2,1)).toEqual(false);
30
-
});
31
-
32
-
// testing negative cases
33
-
// case: the value of the numerater is negative and its absolute value is less than the value of the denominater (roper fraction)
34
-
test(`should return false for proper fraction`,()=>{
19
+
// case: the value of the numerater is negative and its absolute value is less than the value of the denominater (roper fraction)
35
20
expect(isProperFraction(-1,2)).toEqual(true);
36
-
});
37
-
38
-
// case: the value of the numerater is negative and its absolute value is greater than the value of the denominater (improper fraction)
39
-
test(`should return false for improper fraction`,()=>{
40
-
expect(isProperFraction(-2,1)).toEqual(false);
41
-
});
42
-
43
-
// case: the value of the denominator is negative and its absolute value is greater than the value of the numerator (proper fraction)
44
-
test(`should return true for proper fraction`,()=>{
21
+
// case: the value of the denominator is negative and its absolute value is greater than the value of the numerator (proper fraction)
45
22
expect(isProperFraction(1,-2)).toEqual(true);
46
-
});
47
-
48
-
// case: the value of the denominator is negative and its absolute value is less than the value of the numerator (improper fraction)
49
-
test(`should return false for improper fraction`,()=>{
50
-
expect(isProperFraction(2,-1)).toEqual(false);
51
-
});
52
-
53
-
// case: both values of the numerator and denominator are negative and the absolute value of the numerator is less than the absolute value of the denominator (proper fraction)
54
-
test(`should return true for proper fraction`,()=>{
23
+
// case: both values of the numerator and denominator are negative and the absolute value of the numerator is less than the absolute value of the denominator (proper fraction)
55
24
expect(isProperFraction(-1,-2)).toEqual(true);
56
25
});
57
26
58
-
// case: both values of the numerator and denominator are negative and the absolute value of the numerator is greater than the absolute value of the denominator (improper fraction)
27
+
// case: both values are positive and the value of the denominater is less than the value of the numerater (improper fraction)
59
28
test(`should return false for improper fraction`,()=>{
29
+
expect(isProperFraction(2,1)).toEqual(false);
30
+
// case: the value of the numerater is negative and its absolute value is greater than the value of the denominater (improper fraction)
31
+
expect(isProperFraction(-2,1)).toEqual(false);
32
+
// case: both values of the numerator and denominator are negative and the absolute value of the numerator is greater than the absolute value of the denominator (improper fraction)
60
33
expect(isProperFraction(-2,-1)).toEqual(false);
34
+
// case: the value of the denominator is negative and its absolute value is less than the value of the numerator (improper fraction)
0 commit comments