private CVServiceModel GetCVCreatedModelExtended()
        {
            CVServiceModel cv = new CVServiceModel
            {
                Summary        = "summarytest",
                JobExperiences = new List <JobExperienceServiceModel>()
                {
                    new JobExperienceServiceModel()
                    {
                        CompanyName = "Apriorit",
                        ProjectName = "projectnametest",
                        Description = "testdescription",
                        StartDate   = DateTime.Parse("2018-02-13"),
                        FinishDate  = DateTime.Parse("2020-02-13")
                    }
                },
                User = new UserCreationServiceModel()
                {
                    FirstName  = "FN",
                    SecondName = "LN",
                    Email      = "*****@*****.**"
                },
                Educations = new Collection <EducationWithDetailsServiceModel>()
                {
                    new EducationWithDetailsServiceModel()
                    {
                        DegreeId   = new Guid("07a37911-a33e-4248-b8e3-02495f3030d4"),
                        PlaceName  = "DNU",
                        Speciality = "Software Engineering",
                        DateStart  = DateTime.Parse("2017-01-13"),
                        DateEnd    = DateTime.Parse("2020-02-13")
                    }
                },
                QualificationId = new Guid("e2e061e1-201e-41f8-8fb8-1106b00f5ae7"),
                Qualification   = new QualificationServiceModel()
                {
                    Id    = new Guid("e2e061e1-201e-41f8-8fb8-1106b00f5ae7"),
                    Name  = "Middle",
                    Value = 3
                },
                TechnologyId    = new Guid("f43f4b05-6cb1-4c72-9ebb-1fe5fd1fc62e"),
                SkillKnowledges = new Collection <SkillKnowledgeServiceModel>()
                {
                    new SkillKnowledgeServiceModel()
                    {
                        ExperienceId     = new Guid("561d468e-a93b-4e6b-a576-52b3d7bbf32a"),
                        KnowledgeLevelId = new Guid("2cb573c8-c593-445a-a1ca-d072fba8b47e"),
                        SkillId          = new Guid("980a6b85-b828-4553-92bb-410531539036")
                    }
                }
            };

            return(cv);
        }
        public async Task PostCV_CheckData()
        {
            CVCreationRequestModel cv = GetCVCreationRequestModelExtended();
            // Arrange
            var request = new
            {
                Url  = "api/CV",
                Body = cv
            };
            // Act
            var response = await _client.PostAsync(request.Url, ContentHelper.GetStringContent(request.Body));

            var responseBody = await response.Content.ReadAsStringAsync();

            // Assert
            var            actual   = JsonConvert.DeserializeObject <CVServiceModel>(responseBody);
            CVServiceModel expected = GetCVCreatedModelExtended();

            Assert.Equal <CVServiceModel>(expected, actual, new CVServiceModelEqualityComparer());
        }
示例#3
0
 public IActionResult CreatedCV(CVServiceModel cv)
 {
     return(Ok(_cvService.GetByIdAsync(cv.Id)));
 }