예제 #1
0
        public async Task InsertShould_AddNewInternshipToTheContext()
        {
            await sut.Insert(dto, company);

            CollectionAssert.AreEqual(dto.PeriodOfInternship, (await _context.Internships.FirstOrDefaultAsync(x => x.Periods == dto.PeriodOfInternship)).Periods);
            CollectionAssert.AreEqual(dto.Environment, (await _context.Internships.FirstOrDefaultAsync(x => x.Environment == dto.Environment)).Environment);
            CollectionAssert.AreEqual(dto.AssignedStudents, (await _context.Internships.FirstOrDefaultAsync(x => x.AssignedStudents == dto.AssignedStudents)).AssignedStudents);
            CollectionAssert.AreEqual(dto.RequiredFieldsOfStudy, (await _context.Internships.FirstOrDefaultAsync(x => x.RequiredFieldsOfStudy == dto.RequiredFieldsOfStudy)).RequiredFieldsOfStudy);
            CollectionAssert.AreEqual(dto.Activities, (await _context.Internships.FirstOrDefaultAsync(x => x.Activities == dto.Activities)).Activities);
            Assert.AreEqual(dto.Description, (await _context.Internships.FirstOrDefaultAsync(x => x.Description == dto.Description)).Description);
        }