Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Not Alone
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mamadou DIALLO
Not Alone
Commits
bf65f0e5
Commit
bf65f0e5
authored
Dec 04, 2020
by
Mamadou Diallo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dernière version run
parent
5cd76d74
Changes
27
Hide whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
401 additions
and
38 deletions
+401
-38
classesDiagram.png
classesDiagram.png
+0
-0
not-alone-doc/src/doc/asciidoc/_sections/diagrams/classesDiagram.puml
...c/src/doc/asciidoc/_sections/diagrams/classesDiagram.puml
+185
-0
not-alone-server/src/main/java/fr/univnantes/alma/NotAloneApplication.java
...src/main/java/fr/univnantes/alma/NotAloneApplication.java
+1
-2
not-alone-server/src/main/java/fr/univnantes/alma/common/GameService.java
.../src/main/java/fr/univnantes/alma/common/GameService.java
+0
-2
not-alone-server/src/main/java/fr/univnantes/alma/game/InitData.java
...erver/src/main/java/fr/univnantes/alma/game/InitData.java
+6
-0
not-alone-server/src/main/java/fr/univnantes/alma/handler/GameServiceHandler.java
...n/java/fr/univnantes/alma/handler/GameServiceHandler.java
+1
-21
not-alone-server/src/main/java/fr/univnantes/alma/model/cards/Lieu.java
...er/src/main/java/fr/univnantes/alma/model/cards/Lieu.java
+0
-1
not-alone-server/src/main/java/fr/univnantes/alma/model/players/Creature.java
.../main/java/fr/univnantes/alma/model/players/Creature.java
+7
-4
not-alone-server/src/test/java/fr/univnantes/alma/CardTest.java
...one-server/src/test/java/fr/univnantes/alma/CardTest.java
+2
-7
not-alone-web/package-lock.json
not-alone-web/package-lock.json
+10
-0
not-alone-web/package.json
not-alone-web/package.json
+2
-0
not-alone-web/src/app/app.module.ts
not-alone-web/src/app/app.module.ts
+7
-1
not-alone-web/src/app/cards/card-detail/card-detail.component.css
...e-web/src/app/cards/card-detail/card-detail.component.css
+0
-0
not-alone-web/src/app/cards/card-detail/card-detail.component.html
...-web/src/app/cards/card-detail/card-detail.component.html
+1
-0
not-alone-web/src/app/cards/card-detail/card-detail.component.spec.ts
...b/src/app/cards/card-detail/card-detail.component.spec.ts
+25
-0
not-alone-web/src/app/cards/card-detail/card-detail.component.ts
...ne-web/src/app/cards/card-detail/card-detail.component.ts
+18
-0
not-alone-web/src/app/cards/card.service.spec.ts
not-alone-web/src/app/cards/card.service.spec.ts
+16
-0
not-alone-web/src/app/cards/card.service.ts
not-alone-web/src/app/cards/card.service.ts
+18
-0
not-alone-web/src/app/cards/card.ts
not-alone-web/src/app/cards/card.ts
+6
-0
not-alone-web/src/app/cards/card/card.component.css
not-alone-web/src/app/cards/card/card.component.css
+0
-0
not-alone-web/src/app/cards/card/card.component.html
not-alone-web/src/app/cards/card/card.component.html
+1
-0
not-alone-web/src/app/cards/card/card.component.spec.ts
not-alone-web/src/app/cards/card/card.component.spec.ts
+25
-0
not-alone-web/src/app/cards/card/card.component.ts
not-alone-web/src/app/cards/card/card.component.ts
+15
-0
not-alone-web/src/app/cards/cards-list/cards-list.component.css
...one-web/src/app/cards/cards-list/cards-list.component.css
+0
-0
not-alone-web/src/app/cards/cards-list/cards-list.component.html
...ne-web/src/app/cards/cards-list/cards-list.component.html
+1
-0
not-alone-web/src/app/cards/cards-list/cards-list.component.spec.ts
...web/src/app/cards/cards-list/cards-list.component.spec.ts
+25
-0
not-alone-web/src/app/cards/cards-list/cards-list.component.ts
...lone-web/src/app/cards/cards-list/cards-list.component.ts
+29
-0
No files found.
classesDiagram.png
0 → 100644
View file @
bf65f0e5
163 KB
not-alone-doc/src/doc/asciidoc/_sections/diagrams/classesDiagram.puml
0 → 100644
View file @
bf65f0e5
@
startuml
package
model
{
package
interfaces
{
interface
CardInterface
{
getId
()
:
UUID
getPhase
()
:
Phase
getDescription
()
:
String
getTitle
()
:
Object
}
interface
PlayerInterface
{
getHand
()
:
CardInterface
[*]
getDiscards
()
:
CardInterface
[*]
getPlayedCards
()
:
CardInterface
[*]
getName
()
:
String
getId
()
:
UUID
}
}
package
cards
{
abstract
class
Card
{
title
:
Object
description
:
String
id
:
UUID
Card
(
title
:
Object
,
phase
:
Phase
)
generateId
()
:
UUID
toString
()
:
String
addDescription
(
cardTilte
:
Object
):
String
effect
(
cardTitle
:
Object
)
}
class
Lieu
{
Lieu
(
title
:
LieuTile
,
phase
:
Phase
)
abriEffect
()
jungleEffect
()
riviereEffect
()
plageEffect
()
roverEffect
()
maraisEffect
()
antreEffect
()
epaveEffect
()
sourceEffect
()
artifactEffect
()
}
class
Survie
{
Survie
(
title
:
SurvieTitle
,
phase
:
Phase
)
vortexEffect
()
esquiveEffect
()
riposteEffect
()
volteFaceEffect
()
}
class
Traque
{
Traque
(
title
:
TraqueTitle
,
phase
:
Phase
)
mutationEffect
()
flashBackEffect
()
acharnementEffect
()
champsDeForceEffect
()
}
}
package
players
{
class
Player
{
id
:
UUID
name
:
String
Player
(
name
:
String
)
getId
()
:
UUID
getName
()
:
String
getHand
()
:
CardInterface
[*]
getDiscards
()
:
CardInterface
[*]
getPlayedCards
()
:
CardInterface
[*]
initialize
()
draw
(
nbOfCards
:
Integer
)
toString
():
String
}
class
Creature
{
Creature
(
name
:
String
)
toTraque
(
traqued
:
Tracked
)
}
class
Tracked
{
Tracked
(
name
:
String
)
letGo
()
resist
()
}
class
MasterPlayer
{
}
}
package
util
{
enum
LieuTile
{
ANTRE
JUNGLE
RIVIERE
PLAGE
ROVER
MARAIS
ABRI
EPAVE
SOURCE
ARTEFACT
}
enum
Phase
{
ONE
TWO
THREE
FOUR
}
enum
SurvieTitle
{
RIPOSTE
VORTEX
ESQUIVE
VOLTE_FACE
}
enum
TraqueTitle
{
ACHARNEMENT
CHAMPS_DE_FORCE
FLASHBACK
MUTATION
}
}
package
pawns
{
enum
PawnName
{
BALISE
ASSIMILATION
SECOURS
VOLONTE
.................
}
class
Pawn
{
Pawn
(
name
:
PawnName
)
getName
():
PawnName
}
Pawn
*--
"has Name [1]"
PawnName
}
package
tokens
{
enum
TokenName
{
CIBLE
CREATURE
ARTEMIA
}
class
Token
{
Token
(
name
:
TokenName
)
getName
():
TokenName
}
Token
*--
"has Name [1]"
TokenName
}
CardInterface
<|..
Card
PlayerInterface
<|..
Player
Card
<|--
Lieu
Card
<|--
Survie
Card
<|--
Traque
Player
<|--
Creature
Player
<|--
Tracked
Player
*--
"hand [0..n]"
CardInterface
Player
*--
"discards [0..n]
\n
"
CardInterface
Player
*--
"playedCards [0..n]"
CardInterface
Creature
*--
"uses [0..n]"
Lieu
Creature
*--
"uses [0..n]"
Traque
Card
*--
"hasPhase [1]"
Phase
Tracked
*--
"hasCards [0..n]"
Survie
Lieu
*--
"hasTitle [1]
\n\n
"
LieuTile
Survie
*--
"hasTitle [1]"
SurvieTitle
Traque
*--
"hasTitle [1]"
TraqueTitle
}
@
enduml
not-alone-server/src/main/java/fr/univnantes/alma/NotAloneApplication.java
View file @
bf65f0e5
package
fr.univnantes.alma
;
package
fr.univnantes.alma
;
//
import fr.univnantes.alma.thrift.GameServerService;
import
fr.univnantes.alma.thrift.GameServerService
;
import
fr.univnantes.alma.handler.GameServiceHandler
;
import
fr.univnantes.alma.handler.GameServiceHandler
;
import
org.apache.thrift.protocol.TBinaryProtocol
;
import
org.apache.thrift.protocol.TBinaryProtocol
;
import
org.apache.thrift.protocol.TProtocolFactory
;
import
org.apache.thrift.protocol.TProtocolFactory
;
...
@@ -12,7 +12,6 @@ import org.springframework.context.annotation.Bean;
...
@@ -12,7 +12,6 @@ import org.springframework.context.annotation.Bean;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
javax.servlet.Servlet
;
@Configuration
@Configuration
@EnableAutoConfiguration
@EnableAutoConfiguration
...
...
not-alone-server/src/main/java/fr/univnantes/alma/common/GameService.java
View file @
bf65f0e5
package
fr.univnantes.alma.common
;
package
fr.univnantes.alma.common
;
import
fr.univnantes.alma.common.GameJoinRequest
;
public
interface
GameService
{
public
interface
GameService
{
/**
/**
...
...
not-alone-server/src/main/java/fr/univnantes/alma/game/InitData.java
0 → 100644
View file @
bf65f0e5
package
fr.univnantes.alma.game
;
public
class
InitData
{
}
not-alone-server/src/main/java/fr/univnantes/alma/handler/GameServiceHandler.java
View file @
bf65f0e5
package
fr.univnantes.alma.handler
;
package
fr.univnantes.alma.handler
;
import
fr.univnantes.alma.common.GameJoinRequest
;
import
fr.univnantes.alma.common.GameJoinRequest
;
import
fr.univnantes.alma.
core
.InvalidOperationException
;
import
fr.univnantes.alma.
thrift
.InvalidOperationException
;
import
fr.univnantes.alma.thrift.GameNotFound
;
import
fr.univnantes.alma.thrift.GameNotFound
;
import
fr.univnantes.alma.thrift.GameServerService
;
import
fr.univnantes.alma.thrift.GameServerService
;
import
fr.univnantes.alma.thrift.JoinRequest
;
import
fr.univnantes.alma.thrift.JoinRequest
;
...
@@ -30,25 +30,5 @@ public class GameServiceHandler implements GameServerService.Iface {
...
@@ -30,25 +30,5 @@ public class GameServiceHandler implements GameServerService.Iface {
//TODO: translate JoinRequest into GameJoinRequest
//TODO: translate JoinRequest into GameJoinRequest
return
service
.
join
(
gameId
,
new
GameJoinRequest
());
return
service
.
join
(
gameId
,
new
GameJoinRequest
());
}
}
@Override
public
CrossPlatformResource
get
(
int
id
)
throws
InvalidOperationException
,
TException
{
return
null
;
}
@Override
public
List
<
CrossPlatformResource
>
getList
()
throws
InvalidOperationException
,
TException
{
return
null
;
}
@Override
public
boolean
ping
()
throws
InvalidOperationException
,
TException
{
return
false
;
}
@Override
public
void
save
(
CrossPlatformResource
resource
)
throws
InvalidOperationException
,
TException
{
}
}
}
not-alone-server/src/main/java/fr/univnantes/alma/model/cards/Lieu.java
View file @
bf65f0e5
...
@@ -12,7 +12,6 @@ public class Lieu extends Card{
...
@@ -12,7 +12,6 @@ public class Lieu extends Card{
public
Lieu
(
LieuTitle
title
)
{
public
Lieu
(
LieuTitle
title
)
{
super
(
title
);
super
(
title
);
this
.
id
=
this
.
generateId
();
this
.
id
=
this
.
generateId
();
}
}
...
...
not-alone-server/src/main/java/fr/univnantes/alma/model/players/Creature.java
View file @
bf65f0e5
...
@@ -23,10 +23,13 @@ public class Creature extends Player{
...
@@ -23,10 +23,13 @@ public class Creature extends Player{
}
}
i
++;
i
++;
}
}
if
(
card
!=
null
&&
!
tracked
.
resist
()){
if
(
card
!=
null
){
this
.
getHand
().
get
(
i
).
setPower
(
true
);
boolean
resist
=
tracked
.
resist
();
this
.
assimilate
(
tracked
);
if
(!
resist
){
this
.
getHand
().
remove
(
card
);
this
.
getHand
().
get
(
i
).
setPower
(
true
);
this
.
assimilate
(
tracked
);
this
.
getHand
().
remove
(
card
);
}
}
}
}
}
...
...
not-alone-server/src/test/java/fr/univnantes/alma/CardTest.java
View file @
bf65f0e5
package
fr.univnantes.alma
;
package
fr.univnantes.alma
;
import
fr.univnantes.alma.model.cards.Lieu
;
import
fr.univnantes.alma.model.inerfaces.CardInterface
;
import
fr.univnantes.alma.model.utlis.LieuTitle
;
import
fr.univnantes.alma.model.utlis.Phase
;
import
org.junit.jupiter.api.Test
;
import
org.junit.jupiter.api.Test
;
public
class
CardTest
{
public
class
CardTest
{
@Test
@Test
public
void
createCardTest
(){
public
void
createCardTest
(){
CardInterface
card
=
new
Lieu
(
LieuTitle
.
ABRI
,
Phase
.
ONE
);
System
.
out
.
println
(
card
.
toString
());
//assertEquals (card.getPhase(), Phase.ONE);
}
}
}
}
not-alone-web/package-lock.json
View file @
bf65f0e5
...
@@ -2886,6 +2886,11 @@
...
@@ -2886,6 +2886,11 @@
"integrity"
:
"sha1-aN/1++YMUes3cl6p4+0xDcwed24="
,
"integrity"
:
"sha1-aN/1++YMUes3cl6p4+0xDcwed24="
,
"dev"
:
true
"dev"
:
true
},
},
"bootstrap"
:
{
"version"
:
"4.5.3"
,
"resolved"
:
"https://registry.npmjs.org/bootstrap/-/bootstrap-4.5.3.tgz"
,
"integrity"
:
"sha512-o9ppKQioXGqhw8Z7mah6KdTYpNQY//tipnkxppWhPbiSWdD+1raYsnhwEZjkTHYbGee4cVQ0Rx65EhOY/HNLcQ=="
},
"brace-expansion"
:
{
"brace-expansion"
:
{
"version"
:
"1.1.11"
,
"version"
:
"1.1.11"
,
"resolved"
:
"https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz"
,
"resolved"
:
"https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz"
,
...
@@ -6875,6 +6880,11 @@
...
@@ -6875,6 +6880,11 @@
}
}
}
}
},
},
"jquery"
:
{
"version"
:
"3.5.1"
,
"resolved"
:
"https://registry.npmjs.org/jquery/-/jquery-3.5.1.tgz"
,
"integrity"
:
"sha512-XwIBPqcMn57FxfT+Go5pzySnm4KWkT1Tv7gjrpT1srtf8Weynl6R273VJ5GjkRb51IzMp5nbaPjJXMWeju2MKg=="
},
"js-tokens"
:
{
"js-tokens"
:
{
"version"
:
"4.0.0"
,
"version"
:
"4.0.0"
,
"resolved"
:
"https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz"
,
"resolved"
:
"https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz"
,
...
...
not-alone-web/package.json
View file @
bf65f0e5
...
@@ -25,7 +25,9 @@
...
@@ -25,7 +25,9 @@
"@creditkarma/thrift-typescript"
:
"^3.7.6"
,
"@creditkarma/thrift-typescript"
:
"^3.7.6"
,
"@ngtools/webpack"
:
"^10.1.3"
,
"@ngtools/webpack"
:
"^10.1.3"
,
"@types/thrift"
:
"^0.10.10"
,
"@types/thrift"
:
"^0.10.10"
,
"bootstrap"
:
"^4.5.3"
,
"core-js"
:
"^3.6.5"
,
"core-js"
:
"^3.6.5"
,
"jquery"
:
"^3.5.1"
,
"marked"
:
"^1.2.0"
,
"marked"
:
"^1.2.0"
,
"rxjs"
:
"~6.6.3"
,
"rxjs"
:
"~6.6.3"
,
"thrift"
:
"^0.13.0"
,
"thrift"
:
"^0.13.0"
,
...
...
not-alone-web/src/app/app.module.ts
View file @
bf65f0e5
...
@@ -5,13 +5,19 @@ import { AppComponent } from './app.component';
...
@@ -5,13 +5,19 @@ import { AppComponent } from './app.component';
import
{
JetonsComponent
}
from
'
./jetons/jetons.component
'
;
import
{
JetonsComponent
}
from
'
./jetons/jetons.component
'
;
import
{
PionsComponent
}
from
'
./pions/pions.component
'
;
import
{
PionsComponent
}
from
'
./pions/pions.component
'
;
import
{
PisteComponent
}
from
'
./piste/piste.component
'
;
import
{
PisteComponent
}
from
'
./piste/piste.component
'
;
import
{
CardComponent
}
from
'
./cards/card/card.component
'
;
import
{
CardsListComponent
}
from
'
./cards/cards-list/cards-list.component
'
;
import
{
CardDetailComponent
}
from
'
./cards/card-detail/card-detail.component
'
;
@
NgModule
({
@
NgModule
({
declarations
:
[
declarations
:
[
AppComponent
,
AppComponent
,
JetonsComponent
,
JetonsComponent
,
PionsComponent
,
PionsComponent
,
PisteComponent
PisteComponent
,
CardComponent
,
CardsListComponent
,
CardDetailComponent
],
],
imports
:
[
imports
:
[
BrowserModule
BrowserModule
...
...
not-alone-web/src/app/cards/card-detail/card-detail.component.css
0 → 100644
View file @
bf65f0e5
not-alone-web/src/app/cards/card-detail/card-detail.component.html
0 → 100644
View file @
bf65f0e5
<p>
card-detail works!
</p>
not-alone-web/src/app/cards/card-detail/card-detail.component.spec.ts
0 → 100644
View file @
bf65f0e5
import
{
ComponentFixture
,
TestBed
}
from
'
@angular/core/testing
'
;
import
{
CardDetailComponent
}
from
'
./card-detail.component
'
;
describe
(
'
CardDetailComponent
'
,
()
=>
{
let
component
:
CardDetailComponent
;
let
fixture
:
ComponentFixture
<
CardDetailComponent
>
;
beforeEach
(
async
()
=>
{
await
TestBed
.
configureTestingModule
({
declarations
:
[
CardDetailComponent
]
})
.
compileComponents
();
});
beforeEach
(()
=>
{
fixture
=
TestBed
.
createComponent
(
CardDetailComponent
);
component
=
fixture
.
componentInstance
;
fixture
.
detectChanges
();
});
it
(
'
should create
'
,
()
=>
{
expect
(
component
).
toBeTruthy
();
});
});
not-alone-web/src/app/cards/card-detail/card-detail.component.ts
0 → 100644
View file @
bf65f0e5
import
{
Component
,
OnInit
}
from
'
@angular/core
'
;
import
{
Observable
}
from
"
rxjs
"
;
import
{
Card
}
from
"
../card
"
;
@
Component
({
selector
:
'
app-card-detail
'
,
templateUrl
:
'
./card-detail.component.html
'
,
styleUrls
:
[
'
./card-detail.component.css
'
]
})
export
class
CardDetailComponent
implements
OnInit
{
cards
:
Observable
<
Card
[]
>
;
constructor
(
private
cardService
:
CardService
,
)
{
}
ngOnInit
():
void
{
}
}
not-alone-web/src/app/cards/card.service.spec.ts
0 → 100644
View file @
bf65f0e5
import
{
TestBed
}
from
'
@angular/core/testing
'
;
import
{
CardService
}
from
'
./card.service
'
;
describe
(
'
CardService
'
,
()
=>
{
let
service
:
CardService
;
beforeEach
(()
=>
{
TestBed
.
configureTestingModule
({});
service
=
TestBed
.
inject
(
CardService
);
});
it
(
'
should be created
'
,
()
=>
{
expect
(
service
).
toBeTruthy
();
});
});
not-alone-web/src/app/cards/card.service.ts
0 → 100644
View file @
bf65f0e5
import
{
Injectable
}
from
'
@angular/core
'
;
import
{
HttpClient
}
from
"
@angular/common/http
"
;
import
{
Observable
}
from
"
rxjs
"
;
@
Injectable
({
providedIn
:
'
root
'
})
export
class
CardService
{
private
baseUrl
=
""
;
constructor
(
private
http
:
HttpClient
)
{}
getCard
(
id
:
number
):
Observable
<
any
>
{
return
null
;
}
}
not-alone-web/src/app/cards/card.ts
0 → 100644
View file @
bf65f0e5
export
class
Card
{
id
:
Object
;
phase
:
Object
;
title
:
Object
;
description
:
string
}
not-alone-web/src/app/cards/card/card.component.css
0 → 100644
View file @
bf65f0e5
not-alone-web/src/app/cards/card/card.component.html
0 → 100644
View file @
bf65f0e5
<p>
card works!
</p>
not-alone-web/src/app/cards/card/card.component.spec.ts
0 → 100644
View file @
bf65f0e5
import
{
ComponentFixture
,
TestBed
}
from
'
@angular/core/testing
'
;
import
{
CardComponent
}
from
'
./card.component
'
;
describe
(
'
CardComponent
'
,
()
=>
{
let
component
:
CardComponent
;
let
fixture
:
ComponentFixture
<
CardComponent
>
;
beforeEach
(
async
()
=>
{
await
TestBed
.
configureTestingModule
({
declarations
:
[
CardComponent
]
})
.
compileComponents
();
});
beforeEach
(()
=>
{
fixture
=
TestBed
.
createComponent
(
CardComponent
);
component
=
fixture
.
componentInstance
;
fixture
.
detectChanges
();
});
it
(
'
should create
'
,
()
=>
{
expect
(
component
).
toBeTruthy
();
});
});
not-alone-web/src/app/cards/card/card.component.ts
0 → 100644
View file @
bf65f0e5
import
{
Component
,
OnInit
}
from
'
@angular/core
'
;
@
Component
({
selector
:
'
app-card
'
,
templateUrl
:
'
./card.component.html
'
,
styleUrls
:
[
'
./card.component.css
'
]
})
export
class
CardComponent
implements
OnInit
{
constructor
()
{
}
ngOnInit
():
void
{
}
}
not-alone-web/src/app/cards/cards-list/cards-list.component.css
0 → 100644
View file @
bf65f0e5
not-alone-web/src/app/cards/cards-list/cards-list.component.html
0 → 100644
View file @
bf65f0e5
<p>
cards-list works!
</p>
not-alone-web/src/app/cards/cards-list/cards-list.component.spec.ts
0 → 100644
View file @
bf65f0e5
import
{
ComponentFixture
,
TestBed
}
from
'
@angular/core/testing
'
;
import
{
CardsListComponent
}
from
'
./cards-list.component
'
;
describe
(
'
CardsListComponent
'
,
()
=>
{
let
component
:
CardsListComponent
;
let
fixture
:
ComponentFixture
<
CardsListComponent
>
;
beforeEach
(
async
()
=>
{
await
TestBed
.
configureTestingModule
({
declarations
:
[
CardsListComponent
]
})
.
compileComponents
();
});
beforeEach
(()
=>
{
fixture
=
TestBed
.
createComponent
(
CardsListComponent
);
component
=
fixture
.
componentInstance
;
fixture
.
detectChanges
();
});
it
(
'
should create
'
,
()
=>
{
expect
(
component
).
toBeTruthy
();
});
});
not-alone-web/src/app/cards/cards-list/cards-list.component.ts
0 → 100644
View file @
bf65f0e5
import
{
Component
,
OnInit
}
from
'
@angular/core
'
;
import
{
Observable
}
from
"
rxjs
"
;
import
{
Card
}
from
"
../card
"
;
import
{
CardService
}
from
"
../card.service
"
;
import
{
Router
}
from
"
@angular/router
"
;
@
Component
({
selector
:
'
app-cards-list
'
,
templateUrl
:
'
./cards-list.component.html
'
,
styleUrls
:
[
'
./cards-list.component.css
'
]
})
export
class
CardsListComponent
implements
OnInit
{
cards
:
Observable
<
Card
[]
>
;
constructor
(
private
cardService
:
CardService
,
private
router
:
Router
)
{
}
ngOnInit
():
void
{
this
.
reloadData
();
}
reloadData
(){
this
.
cards
=
null
;
}