Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Hagraah Pendu
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sofiane Lasri
Hagraah Pendu
Commits
c1fe478e
Commit
c1fe478e
authored
2 years ago
by
Sofiane Lasri
Browse files
Options
Downloads
Patches
Plain Diff
Ajout des méthodes requises pour la création managedContext dans les tests.
parent
ac7a9c56
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Pendu/GameEngineTests.swift
+26
-0
26 additions, 0 deletions
Pendu/GameEngineTests.swift
with
26 additions
and
0 deletions
Pendu/GameEngineTests.swift
+
26
−
0
View file @
c1fe478e
...
...
@@ -9,6 +9,32 @@ import XCTest
class
GameEngineTests
:
XCTestCase
{
var
managedObjectContext
:
NSManagedObjectContext
!
override
func
setUp
()
{
super
.
setUp
()
// Configuration du Persistent Store Coordinator spécifique aux tests
let
managedObjectModel
=
NSManagedObjectModel
.
mergedModel
(
from
:
[
Bundle
.
main
])
!
let
persistentStoreCoordinator
=
NSPersistentStoreCoordinator
(
managedObjectModel
:
managedObjectModel
)
do
{
try
persistentStoreCoordinator
.
addPersistentStore
(
ofType
:
NSInMemoryStoreType
,
configurationName
:
nil
,
at
:
nil
,
options
:
nil
)
}
catch
{
fatalError
(
"Erreur lors de la création du Persistent Store Coordinator spécifique aux tests :
\(
error
)
"
)
}
// Création du contexte géré spécifique aux tests
managedObjectContext
=
NSManagedObjectContext
(
concurrencyType
:
.
mainQueueConcurrencyType
)
managedObjectContext
.
persistentStoreCoordinator
=
persistentStoreCoordinator
}
override
func
tearDown
()
{
// Nettoyage après chaque test si nécessaire
super
.
tearDown
()
}
override
func
setUpWithError
()
throws
{
// Put setup code here. This method is called before the invocation of each test method in the class.
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment