public static GeneralSelectionItem MapCourseProjectionToGeneralSelectionItem(CourseCodeSubjectNameProjection x) { return(new GeneralSelectionItem { ID = x.CourseID, DisplayName = x.CourseCodeWithSubjectName }); }
public void MapCourseProjectionToGeneralSelectionItem_WhenPassedValidProjectionModelID_ReturnsValidSelectionItemID() { var projection = new CourseCodeSubjectNameProjection { CourseCodeWithSubjectName = "Name", CourseID = Guid.NewGuid().ToString() }; var mapped = MapCourse.MapCourseProjectionToGeneralSelectionItem(projection); Assert.True(Guid.TryParse(mapped.ID, out Guid result)); }
public void MapCourseProjectionToGeneralSelectionItem_WhenPassedValidProjectionModel_ReturnsValidSelectionItem() { string name = "Name"; string guid = Guid.NewGuid().ToString(); var projection = new CourseCodeSubjectNameProjection { CourseCodeWithSubjectName = name, CourseID = guid }; var mapped = MapCourse.MapCourseProjectionToGeneralSelectionItem(projection); Assert.Equal(name, mapped.DisplayName); Assert.Equal(guid, mapped.ID); }