forked from IgorMinar/Memory-Game
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
8 changed files
with
86 additions
and
76 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 |
---|---|---|
@@ -1,5 +1,9 @@ | ||
/* app css stylesheet */ | ||
|
||
div { | ||
font-size: 30px; | ||
} | ||
|
||
.menu { | ||
list-style: none; | ||
border-bottom: 0.1em solid black; | ||
|
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
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,36 @@ | ||
/* jasmine specs for controllers go here */ | ||
|
||
describe('MemoryGameApp', function() { | ||
|
||
beforeEach(module('memoryGameApp')); | ||
|
||
|
||
describe('GameCtrl', function(){ | ||
var gameCtrl, scope; | ||
|
||
beforeEach(inject(function($controller, $rootScope){ | ||
scope = $rootScope.$new(); | ||
gameCtrl = $controller('GameCtrl', {$scope: scope}); | ||
})); | ||
|
||
|
||
it('should publish the game model', function() { | ||
expect(scope.game).toBeDefined(); | ||
}); | ||
}); | ||
|
||
|
||
describe('game', function(){ | ||
var game; | ||
|
||
|
||
beforeEach(inject(function(_game_){ | ||
game = _game_; | ||
})); | ||
|
||
|
||
it('should create a game with 8 tile pairs', function() { | ||
expect(game.unmatchedPairs).toBe(8); | ||
}); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,42 @@ | ||
describe('Game', function() { | ||
|
||
var tileNames = ['turtle', 'hammer'], | ||
game; | ||
|
||
beforeEach(function() { | ||
game = new Game(tileNames); | ||
}); | ||
|
||
|
||
describe('init', function() { | ||
it('should create a 2x2 grid', function() { | ||
expect(game.grid.length).toBe(2); | ||
expect(game.grid[0].length).toBe(2); | ||
expect(game.grid[1].length).toBe(2); | ||
}); | ||
|
||
|
||
it('should initialize unmatchedPairs and message', function() { | ||
expect(game.message).toBe('Click on a tile.'); | ||
expect(game.unmatchedPairs).toBe(2); | ||
}); | ||
}); | ||
|
||
|
||
describe('flip', function() { | ||
it('should set the flipped flag on the tile being flipped', function() { | ||
var tile = game.grid[0][0]; | ||
expect(tile.flipped).toBe(false); | ||
game.flipTile(tile); | ||
expect(tile.flipped).toBe(true); | ||
}); | ||
|
||
it('should update the image name when a tile is flipped', function() { | ||
var tile = game.grid[0][0]; | ||
expect(tile.imgName()).toBe('back'); | ||
|
||
game.flipTile(tile); | ||
expect(tile.imgName()).not.toBe('back'); | ||
}); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.