Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
blog_lab2_sab
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Jan H
blog_lab2_sab
Commits
6ae5ab5a
Commit
6ae5ab5a
authored
3 years ago
by
as
Browse files
Options
Downloads
Patches
Plain Diff
Fix test db
parent
c8bf7a93
Branches
master
remote-run/isthatafix
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Blog.DAL.Tests/RepositoryTests.cs
+4
-0
4 additions, 0 deletions
Blog.DAL.Tests/RepositoryTests.cs
with
4 additions
and
0 deletions
Blog.DAL.Tests/RepositoryTests.cs
+
4
−
0
View file @
6ae5ab5a
...
...
@@ -21,6 +21,10 @@ namespace Blog.DAL.Tests
var
context
=
new
BlogContext
();
context
.
Database
.
CreateIfNotExists
();
var
repository
=
new
BlogRepository
();
// -- prepare data in db
context
.
Posts
.
ToList
().
ForEach
(
x
=>
context
.
Posts
.
Remove
(
x
));
context
.
Posts
.
Add
(
new
Post
{
Author
=
"test"
,
Content
=
"test, test, test..."
});
context
.
SaveChanges
();
// act
var
result
=
repository
.
GetAllPosts
();
// assert
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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