Skip to content

Commit 4917b18

Browse files
authored
Merge branch 'code-differently:main' into main
2 parents 411dca2 + a4c4623 commit 4917b18

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

lesson_05/mercedesmathews/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# User stories for a music platform when walking and running
2+
3+
- As a runner, I want an app to track how fast i'm running, so that it can play music that matches my pace.
4+
- As a spotify listener, I want the app to link with my spotify, so that it can play music from my own playlists.
5+
- As a user, I want to add my music preferences, so that the app can generate music based off of them.

lesson_07/conditionals/src/lesson7.test.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {
22
binarySearch,
33
compareStrings,
4+
computeFactorial,
45
getFirstNFibonacciNumbers,
56
} from "./lesson7.js";
67

@@ -42,4 +43,20 @@ describe("Lesson7 Tests", () => {
4243
// Test for value not present in the array
4344
expect(binarySearch(values, 0, values.length - 1, 4)).toBe(-1);
4445
});
46+
test("testComputeFactorial", () => {
47+
// Test for n = 0 (edge case)
48+
expect(computeFactorial(0)).toBe(1);
49+
50+
// Test for n = 1
51+
expect(computeFactorial(1)).toBe(1);
52+
53+
// Test for n = 5
54+
expect(computeFactorial(5)).toBe(120);
55+
56+
// Test for n = 10
57+
expect(computeFactorial(10)).toBe(3628800);
58+
59+
// Test for negative n (edge case)
60+
expect(computeFactorial(-5)).toBe(0);
61+
});
4562
});

0 commit comments

Comments
 (0)