public void Should_Add_Requirement() { var vacancyData = new { Title = "C# Developer", Description = "Preffered with side ruby history", OpenDate = DateTime.Now, CloseDate = DateTime.Now.AddMonths(1) }; var requirementData = new { SkillType = SkillType.Technical, RequirementType = RequirementType.NiceToHave, Content = "Python" }; var vacancy = new Vacancy(vacancyData.Title, vacancyData.Description, vacancyData.OpenDate, vacancyData.CloseDate); vacancy.AddRequirement(new Requirement(requirementData.Content, requirementData.SkillType, requirementData.RequirementType)); Assert.Equal(1, vacancy.Requirements.Count); }
public void Should_Update_Requirement() { var vacancyData = new { Title = "C# Developer", Description = "Preffered with side ruby history", OpenDate = DateTime.Now, CloseDate = DateTime.Now.AddMonths(1) }; var requirementData = new { SkillType = SkillType.Technical, RequirementType = RequirementType.NiceToHave, Content = "Python" }; var requirementUpdateData = new { SkillType = SkillType.Technical, RequirementType = RequirementType.NiceToHave, Content = "Python" }; var vacancy = new Vacancy(vacancyData.Title, vacancyData.Description, vacancyData.OpenDate, vacancyData.CloseDate); vacancy.AddRequirement(new Requirement(requirementData.Content, requirementData.SkillType, requirementData.RequirementType)); var requirement = vacancy.Requirements.FirstOrDefault(); var newRequirement = new Requirement(requirementUpdateData.Content, requirement.SkillType, requirementUpdateData.RequirementType); vacancy.UpdateRequirement(requirement, newRequirement); requirement = vacancy.Requirements.FirstOrDefault(); Assert.NotEmpty(vacancy.Requirements); Assert.NotNull(requirement); Assert.Equal(newRequirement.Content, requirement.Content); Assert.Equal(newRequirement.SkillType, requirement.SkillType); Assert.Equal(newRequirement.RequirementType, requirement.RequirementType); }