Skip to content

Commit 8e9e5b9

Browse files
committed
Add quiz + mini-quiz placeholders + file structure
1 parent 41a92e9 commit 8e9e5b9

File tree

27 files changed

+531
-0
lines changed

27 files changed

+531
-0
lines changed

pages/lessons/projects/4.mdx

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,17 @@ Here you'll:
2222
- Walk away with many practical tests for smart contracts
2323
- Nibble on some food for thought about test-driven development
2424

25+
<SideDrawer buttonText="Warm-up Questions" title="Some previous knowledge, some prediction">
26+
<Question question="lesson-4/1-intro/Q1" />
27+
<Question question="lesson-4/1-intro/Q2" />
28+
<Question question="lesson-4/1-intro/Q3" />
29+
<Question question="lesson-4/1-intro/Q4" />
30+
<Question question="lesson-4/1-intro/Q5" />
31+
</SideDrawer>
32+
33+
PART 1
34+
35+
2536
## Why automated testing?
2637

2738
Testing can:
@@ -199,6 +210,14 @@ module.exports = {
199210
solidity: '0.8.12',
200211
}
201212
```
213+
<SideDrawer buttonText="Checkpoint Questions" title="Setting up our Environment">
214+
<Question question="lesson-4/2-get-set-up/Q1" />
215+
<Question question="lesson-4/2-get-set-up/Q2" />
216+
<Question question="lesson-4/2-get-set-up/Q3" />
217+
<Question question="lesson-4/2-get-set-up/Q4" />
218+
<Question question="lesson-4/2-get-set-up/Q5" />
219+
</SideDrawer>
220+
PART 2
202221

203222
## What do we want to test on our TierNFT contract?
204223

@@ -397,6 +416,16 @@ failure looks like:
397416
+Anita
398417
```
399418

419+
<SideDrawer buttonText="Checkpoint Questions" title="General Testing Concepts">
420+
<Question question="lesson-4/3-general-concepts/Q1" />
421+
<Question question="lesson-4/3-general-concepts/Q2" />
422+
<Question question="lesson-4/3-general-concepts/Q3" />
423+
<Question question="lesson-4/3-general-concepts/Q4" />
424+
<Question question="lesson-4/3-general-concepts/Q5" />
425+
</SideDrawer>
426+
427+
PART 3
428+
400429
### Let's add tests for mint()
401430

402431
Now is time to add tests for our `mint()` method. We'll group these new tests
@@ -572,6 +601,16 @@ of additional highlights:
572601
breaks our rule of one expect per test, but as long as the test is kept
573602
simple, we can choose what makes sense for what we're trying to test.
574603

604+
<SideDrawer buttonText="Checkpoint Questions" title="Mint and Withdraw">
605+
<Question question="lesson-4/4-mint-withdraw/Q1" />
606+
<Question question="lesson-4/4-mint-withdraw/Q2" />
607+
<Question question="lesson-4/4-mint-withdraw/Q3" />
608+
<Question question="lesson-4/4-mint-withdraw/Q4" />
609+
<Question question="lesson-4/4-mint-withdraw/Q5" />
610+
</SideDrawer>
611+
612+
PART 4
613+
575614
### Testing tokenURI()
576615

577616
Here's where things get even more interesting!
@@ -856,6 +895,16 @@ while refactoring to make sure we didn't break things along the way, and it's
856895
helpful at the end to ensure the `tokenURI()` method continues to work without
857896
fail when code changes.
858897

898+
<SideDrawer buttonText="Checkpoint Questions" title="Testing the SVG">
899+
<Question question="lesson-4/5-SVG-test/Q1" />
900+
<Question question="lesson-4/5-SVG-test/Q2" />
901+
<Question question="lesson-4/5-SVG-test/Q3" />
902+
<Question question="lesson-4/5-SVG-test/Q4" />
903+
<Question question="lesson-4/5-SVG-test/Q5" />
904+
</SideDrawer>
905+
906+
OUTRO
907+
859908
## Food for Thought
860909

861910
With all the helpfulness of tests, why didn't we start with them before we wrote
@@ -889,6 +938,10 @@ With TDD:
889938
Bolting on tests after the fact can be painful and boring, and you lose the
890939
potential code improvements you can make when you test as you go.
891940

941+
<br/>
942+
<Quiz quiz="lesson-4-quiz" />
943+
<br/>
944+
892945
Go forth, test, and prosper knowing you have confidence in the code you're
893946
deploying into the world.
894947

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"question": "Choose what NFTs can do? Multiple answers possible.",
3+
"options": [
4+
{
5+
"answer": "Give access to a DAO",
6+
"correct": true
7+
},
8+
{
9+
"answer": "Do the dishes"
10+
},
11+
{
12+
"answer": "Represent a concert ticket",
13+
"correct": true
14+
},
15+
{
16+
"answer": "Point to storage of an album",
17+
"correct": true
18+
},
19+
{
20+
"answer": "Replicate one NFT with another"
21+
}
22+
]
23+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"question": "What is Hardhat? ",
3+
"options": [
4+
{
5+
"answer": "A set of tools that includes a local mini blockchain that can run on your machine",
6+
"correct": true
7+
},
8+
{
9+
"answer": "A code editor in the browser "
10+
},
11+
{
12+
"answer": "A security patch for most Linux operating systems"
13+
},
14+
{
15+
"answer": "Safety apparel for space travel "
16+
}
17+
]
18+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"question": "In Solidity, what does the ^ symbol represent when specifying the compiler version?",
3+
"options": [
4+
{
5+
"answer": "It denotes an exclusive compiler version"
6+
},
7+
{
8+
"answer": "It indicates a fallback function"
9+
},
10+
{
11+
"answer": "It signifies a dangerous computation"
12+
},
13+
{
14+
"answer": " It specifies a compatible range of compiler versions",
15+
"correct": true
16+
}
17+
]
18+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"question": "Which address does the msg.sender variable represent in Solidity?",
3+
"options": [
4+
{
5+
"answer": "The contract owner"
6+
},
7+
{
8+
"answer": "The Ethereum smart contract"
9+
},
10+
{
11+
"answer": "The Ethereum network"
12+
},
13+
{
14+
"answer": "The caller of the current function",
15+
"correct": true
16+
}
17+
]
18+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"question": "What is npm? ",
3+
"options": [
4+
{
5+
"answer": "A Node.js module that provides a blockchain for running smart contracts"
6+
},
7+
{
8+
"answer": "A package manager from Node.js ",
9+
"correct": true
10+
},
11+
{
12+
"answer": "A framework for building web applications "
13+
}
14+
]
15+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"question": "Which of the following can we achieve with automated testing?",
3+
"options": [
4+
{
5+
"answer": "bla bla bla."
6+
},
7+
{
8+
"answer": "Create a project."
9+
},
10+
{
11+
"answer": "Create a smart contract using a code editor."
12+
},
13+
{
14+
"answer": "All of the above",
15+
"correct": true
16+
}
17+
]
18+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"question": "When setting up dependencies, what is relevant to our testing environment? ",
3+
"options": [
4+
{
5+
"answer": "bla bla bla."
6+
},
7+
{
8+
"answer": "It tells npm to save the dependencies in a development environment.",
9+
"correct": true
10+
},
11+
{
12+
"answer": "It tells npm to save the dependencies in a production environment"
13+
}
14+
]
15+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"question": "What is the benefit of using Open Zeppelin contracts in smart contract development?",
3+
"options": [
4+
{
5+
"answer": "They reduce the amount of code we write"
6+
},
7+
{
8+
"answer": "They provide rigorously audited and safe contracts"
9+
},
10+
{
11+
"answer": "They allow for easier human collaboration and technical interoperability"
12+
},
13+
{
14+
"answer": "All of the above",
15+
"correct": true
16+
}
17+
]
18+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"question": "We will cover this later, but what do you think the purpose of the .gitignore file created by Hardhat is?",
3+
"options": [
4+
{
5+
"answer": "To hide your project's dependencies."
6+
},
7+
{
8+
"answer": "To store your project's source code in a private Github repository."
9+
},
10+
{
11+
"answer": "To ensure that certain files not tracked by Git remain untracked",
12+
"correct": true
13+
}
14+
]
15+
}

0 commit comments

Comments
 (0)