This file contains hidden or 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
PM> Install-Package MockQueryable.Moq |
This file contains hidden or 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
var handler = new GetTodosQuery.GetTodosQueryHandler(mockedDbContext.Object, _mapper); |
This file contains hidden or 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
var mockDbSet = todoListEntities.AsQueryable().BuildMockDbSet(); | |
mockedDbContext.Setup(db => db.TodoLists).Returns(mockDbSet.Object); |
This file contains hidden or 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
var todoListEntities = new List<TodoList> | |
{ | |
new TodoList{Colour="Blue", Items = new List<TodoItem>{ | |
new TodoItem{Title="Dynamics" }, | |
new TodoItem{Title="Case" }, | |
new TodoItem{Title="Management" }, | |
new TodoItem{Title="Accelerator" }, | |
new TodoItem{Title="HSD" } | |
} | |
} |
This file contains hidden or 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
var mockedDbContext = new Mock<IApplicationDbContext>(); |
This file contains hidden or 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
[Collection("QueryTests")] | |
public class GetTodosQueryTests { | |
private readonly ApplicationDbContext _context; | |
private readonly IMapper _mapper; | |
public GetTodosQueryTests(QueryTestFixture fixture) { | |
_mapper = fixture.Mapper; | |
} | |
[Fact] |
This file contains hidden or 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
[Collection("QueryTests")] | |
public class GetTodosQueryTests { | |
private readonly ApplicationDbContext _context; | |
private readonly IMapper _mapper; | |
public GetTodosQueryTests(QueryTestFixture fixture) { | |
_context = fixture.Context; | |
_mapper = fixture.Mapper; | |
} |
This file contains hidden or 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
[alias] | |
co = checkout | |
cob = checkout -b | |
coo = !git fetch && git checkout | |
br = branch | |
brd = branch -d | |
brD = branch -D | |
merged = branch --merged | |
dmerged = "git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d" | |
st = status |
This file contains hidden or 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
<div *ngIf="(loading$ | async) === false"> | |
<ul> | |
<li *ngFor="let p of posts$ | async"> | |
{{p.title}} | |
</li> | |
</ul> | |
</div> | |
<div *ngIf="(loading$ | async) === true"> | |
Loading..... | |
</div> |
This file contains hidden or 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
import { Observable } from 'rxjs/Observable'; | |
import { Component, OnInit } from '@angular/core'; | |
import { ActivatedRoute } from '@angular/router'; | |
import { Select, Store } from '@ngxs/store'; | |
import { FetchPosts } from '../../shared/posts/post.actions'; | |
import { PostState } from '../../shared/posts/post.store'; | |
@Component({ |
NewerOlder