public void MultipleJobExperiencesAreReturned()
        {
            var company     = "Ryanair";
            var description = "Software Engineer";
            var startDate   = new DateTime(2019, 09, 09);
            var endDate     = new DateTime(2021, 07, 01);
            var techStack   = new[] { ".Net", "MySQL" };

            var otherCompany     = "1millionBot";
            var otherDescription = "Web Developer";
            var otherStartDate   = new DateTime(2018, 02, 09);
            var otherEndDate     = new DateTime(2018, 09, 01);
            var otherTechStack   = new[] { "Node.js", "MongoDB" };

            AssumeDataInRepository(new[]
            {
                new JobExperienceBuilder()
                .WithCompany(company)
                .WithDescription(description)
                .WithStartDate(startDate)
                .WithEndDate(endDate)
                .WithTechStack(techStack)
                .Build(),
                new JobExperienceBuilder()
                .WithCompany(otherCompany)
                .WithDescription(otherDescription)
                .WithStartDate(otherStartDate)
                .WithEndDate(otherEndDate)
                .WithTechStack(otherTechStack)
                .Build()
            });

            var jobExperiences = service.GetJobExperiences().ToArray();

            Assert.That(jobExperiences.Length, Is.EqualTo(2));
            AssertJobExperience(jobExperiences[0], company, description, startDate, endDate, techStack);
            AssertJobExperience(jobExperiences[1], otherCompany, otherDescription, otherStartDate, otherEndDate, otherTechStack);
        }
Beispiel #2
0
 public async Task <IEnumerable <JobExperienceDto> > Handle(GetJobExperiencesQuery request, CancellationToken cancellationToken)
 {
     return(await Task.Run(() => jobExperienceService.GetJobExperiences(), cancellationToken));
 }