codersforcauses / codersforcauses/software-engineering-practices-demo-2024-winter
Create a test for the multiplication operation
- Dominant language
- Python
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
### **Task**
Create a test for the ```multiplication``` operation. This can be seen at ```tests/test.operations.py``` with the function called ```test_multiplication```.
### **Acceptance Criteria**
- the test should fail if ```multiplication``` is mathematically wrong
- the test should succeed if ```multiplication``` is mathematically correct
### **Answer**
Note: It is not expected that you know how to write tests, your goal is to understand what the below code does and perform the change on your branch that you have created and create a pull request
```
def test_multiplication():
"""
GIVEN: two numbers
WHEN: passed in to the function multiplication
THEN: the result is the multiplication of the two numbers
"""
assert multiplication(3, 5) == (15)
assert multiplication(0, 4) == (0)
assert multiplication(1, -7) == (-7)
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Open tests/test.operations.py and locate test_multiplication. Run the existing test suite first to see the current structure and imports. Add coverage for positive, zero, and negative operands, then confirm the test fails for an incorrect multiplication result and passes for the correct implementation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing-qa
- Issue type
- Feature
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 50/100