public IEnumerable <ResumeItemModel> GetUniversityDiplomas() { IEnumerable <ResumeItemModel> items = new List <ResumeItemModel>(); if (_isInitialized) { items = _resumeDoc.Descendants("education").Descendants("edu") .Select(item => ResumeMapper.ToResumeItemModel(new ResumeItemModelXmlDao(item))); } return(items); }
public IEnumerable <ResumeItemModel> GetWorkExperiences() { IEnumerable <ResumeItemModel> items = new List <ResumeItemModel>(); if (_isInitialized) { items = _resumeDoc.Descendants("experiences").Descendants("exp") .Select(item => ResumeMapper.ToResumeItemModel(new ResumeItemModelXmlDao(item))); } return(items); }
public void ResumeMapperUnitTests_ToResumeItemModel() { // Arrange const string imageValue = "a"; const string titleValue = "b"; const string shortTitleValue = "c"; const string locationValue = "d"; const string shortLocationValue = "e"; const string descriptionValue = "f"; const string techValue = "g"; XElement element = new XElement( "Root", new XElement("image", imageValue), new XElement("title", titleValue), new XElement("short-title", shortTitleValue), new XElement("location", locationValue), new XElement("short-location", shortLocationValue), new XElement("description", descriptionValue), new XElement("tech", techValue) ); IResumeItemModelDao dao = new ResumeItemModelXmlDao(element); // Act ResumeItemModel model = ResumeMapper.ToResumeItemModel(dao); // Assert Assert.IsNotNull(model); Assert.AreEqual(imageValue, model.Image); Assert.AreEqual(titleValue, model.Title); Assert.AreEqual(shortTitleValue, model.ShortTitle); Assert.AreEqual(locationValue, model.Location); Assert.AreEqual(shortLocationValue, model.ShortLocation); Assert.AreEqual(descriptionValue, model.Description); Assert.AreEqual(techValue, model.Tech); }