public async Task GetAllForResume_WithData_WorksCorrectly()
        {
            var context = new JobFinderDbContext(new DbContextOptionsBuilder <JobFinderDbContext>()
                                                 .UseInMemoryDatabase(Guid.NewGuid().ToString())
                                                 .Options);

            var expectedResults = new[] { "Position1", "Position2", "Position3" }
            .OrderBy(c => c)
            .ToArray();

            var model = new Resume()
            {
                WorkHistory = new List <WorkExperience>()
                {
                    new WorkExperience()
                    {
                        Position  = expectedResults[0],
                        Institute = "InstituteTest",
                        From      = 2000,
                        To        = 2001,
                    },
                    new WorkExperience()
                    {
                        Position  = expectedResults[1],
                        Institute = "InstituteTest",
                        From      = 2000,
                        To        = 2001,
                    },
                    new WorkExperience()
                    {
                        Position  = expectedResults[2],
                        Institute = "InstituteTest",
                        From      = 2000,
                        To        = 2001,
                    },
                }
            };

            await context.AddAsync(model);

            context.SaveChanges();

            var workService = new WorkHistoryService(new EfRepository <Resume>(context),
                                                     new EfRepository <WorkExperience>(context));

            var actualResults = (await workService.GetAllForResume(model.Id))
                                .Select(w => w.Position)
                                .OrderBy(w => w)
                                .ToArray();

            Assert.Equal(expectedResults, actualResults);
        }
        public async Task GetAllForResume_WithNoResume_ReturnsNull()
        {
            var context = new JobFinderDbContext(new DbContextOptionsBuilder <JobFinderDbContext>()
                                                 .UseInMemoryDatabase(Guid.NewGuid().ToString())
                                                 .Options);

            var model = new Resume();

            var workService = new WorkHistoryService(new EfRepository <Resume>(context),
                                                     new EfRepository <WorkExperience>(context));

            var result = await workService.GetAllForResume(model.Id);

            Assert.Null(result);
        }