コード例 #1
0
 public static GeneralSelectionItem MapCourseProjectionToGeneralSelectionItem(CourseCodeSubjectNameProjection x)
 {
     return(new GeneralSelectionItem
     {
         ID = x.CourseID,
         DisplayName = x.CourseCodeWithSubjectName
     });
 }
コード例 #2
0
        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));
        }
コード例 #3
0
        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);
        }