Skip to content

Commit

Permalink
Create cat.spec.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
EgoriusTheGreat2 authored Nov 6, 2023
1 parent 3398132 commit 0e986cc
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions rpgsaga/saga/tests/cat.spec.ts
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('Шотландский вислоухий');
});
});

0 comments on commit 0e986cc

Please sign in to comment.