-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3398132
commit 0e986cc
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { Cat } from '../src/cat'; | ||
|
||
describe('Testing cat constructor', () => { | ||
it('Cat should be created', () => { | ||
const cat1 = new Cat(7, 'Кеша', 'Шотландский вислоухий', 5); | ||
expect(cat1.Age).toEqual(7); | ||
expect(cat1.Name).toEqual('Кеша'); | ||
expect(cat1.Breed).toEqual('Шотландский вислоухий'); | ||
expect(cat1.Weight).toEqual(5); | ||
}); | ||
}); | ||
|
||
describe('Testing cat methods', () => { | ||
it('Cat new age value', () => { | ||
const cat1 = new Cat(7, 'Кеша', 'Шотландский вислоухий', 5); | ||
cat1.Age = 7; | ||
expect(cat1.Age).toEqual(7); | ||
}); | ||
it('Cat new name value', () => { | ||
const cat1 = new Cat(7, 'Кеша', 'Шотландский вислоухий', 5); | ||
cat1.Name = 'Кеша'; | ||
expect(cat1.Name).toEqual('Кеша'); | ||
}); | ||
it('Cat new weight', () => { | ||
const cat1 = new Cat(7, 'Кеша', 'Шотландский вислоухий', 5); | ||
cat1.Weight = 5; | ||
expect(cat1.Weight).toEqual(5); | ||
}); | ||
it('Cat new breed', () => { | ||
const cat1 = new Cat(7, 'Кеша', 'Шотландский вислоухий', 5); | ||
cat1.Breed = 'Шотландский вислоухий'; | ||
expect(cat1.Breed).toEqual('Шотландский вислоухий'); | ||
}); | ||
}); |