public async Task GetEntityListTest() { var fakeRepositoryMock = new Mock <IActorsContext>(); fakeRepositoryMock.Setup(x => x.GetActorsList()).ReturnsAsync(vars); var actorService = new ActorsService(fakeRepositoryMock.Object); var result = await actorService.GetActorsList(); Assert.Collection(result, var => { Assert.Equal("Seb Seb", var.Name); }, car => { Assert.Equal("Ham Ham", var.Name); }); }