Last active
February 25, 2020 01:04
-
-
Save mlevkovsky/8d7ff4e9a0016423034ea1b3c3d5698f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class Calculator { | |
public add(firstAddend: number, secondAddend: number): number { | |
return firstAddend + secondAddend; | |
} | |
public subtract(minuend: number, subtrahend: number): number { | |
return minuend + subtrahend; | |
} | |
public multiply(firstFactor: number, secondFactor: number): number { | |
return firstFactor * secondFactor; | |
} | |
} | |
// ✅test passes, we're all happy | |
describe('Calculator', () => { | |
it('sums up two numbers properly', () => { | |
calculator = new Calculator(); | |
expect(calculator.add(2,2)).to.equal(4); | |
}); | |
it('subtracts two numbers properly', () => { | |
calculator = new Calculator(); | |
expect(calculator.subtract(0,0)).to.equal(0); | |
}); | |
it('multiplies two numbers properly', () => { | |
calculator = new Calculator(); | |
expect(calculator.subtract(2,2)).to.equal(4); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment