コード例 #1
0
        public void MapFromDomainEntity_NullContent_ReturnNull()
        {
            //Act
            var response = ProjectTheme.MapFromDomainEntity(null);

            //Assert
            Assert.IsNull(response);
        }
コード例 #2
0
        public static ProjectThemeDTO MapFromDatabaseEntity(ProjectTheme projectTheme)
        {
            if (projectTheme == null)
            {
                return(null);
            }

            return(new ProjectThemeDTO()
            {
                Id = projectTheme.Id,
                Value = projectTheme.Value,
                Position = projectTheme.Position
            });
        }
コード例 #3
0
        public void MapFromDomainEntity_ValidEntity_ReturnDTOEntity()
        {
            //Arrange
            var projectTheme = new ProjectThemeDTO()
            {
                Id       = Guid.NewGuid(),
                Value    = "BAU",
                Position = 0
            };
            var response = ProjectTheme.MapFromDomainEntity(projectTheme);

            Assert.IsNotNull(response);
            Assert.AreEqual(projectTheme.Id, response.Id);
            Assert.AreEqual(projectTheme.Value, response.Value);
            Assert.AreEqual(projectTheme.Position, response.Position);
        }
コード例 #4
0
        private static void SeedProjectTheme(CapRedV2Context context)
        {
            if (context.ProjectThemes.Any())
            {
                return;
            }
            string[] projectThemes =
            {
                "BAU",                                        "Corporate Platform", "CSO", "Real Estate", "Aladdin Platform", "Employee Experience", "External Business Request - Aladdin Platform",
                "External Business Request - Aladdin Client", "Information Security"
            };

            for (int i = 0; i < projectThemes.Length; i++)
            {
                var projectTheme = new ProjectTheme {
                    Id = Guid.NewGuid(), Position = i, Value = projectThemes[i]
                };
                context.ProjectThemes.Add(projectTheme);
            }
        }