public void CreatesFromSummaryCorrectly()
        {
            var skill1 = new SkillSummary {
                SkillId = "skill1", Stage = SkillStage.Development
            };
            var skill2dev = new SkillSummary {
                SkillId = "skill2", Stage = SkillStage.Development
            };
            var skill2live = new SkillSummary {
                SkillId = "skill2", Stage = SkillStage.Live
            };

            var skillsets = SkillSet.From(null, skill2dev, skill1, skill2live).ToArray();

            Assert.Equal(2, skillsets.Length);

            var skill1set = skillsets.First(s => s.ID == "skill1");

            Assert.Equal(SkillStage.Development, skill1set.Development.Stage);
            Assert.Null(skill1set.Live.Stage);

            var skill2set = skillsets.First(s => s.ID == "skill2");

            Assert.Equal(SkillStage.Development, skill2set.Development.Stage);
            Assert.Equal(SkillStage.Live, skill2set.Live.Stage);
        }
        private SkillSet GetSkillSet(SkillStage stage, string preferredLocale)
        {
            var skill1 = new SkillSummary
            {
                SkillId      = "skill1",
                Stage        = stage,
                NameByLocale = new Dictionary <string, string>
                {
                    { "de-DE", "german" },
                    { "en-GB", "british" }
                }
            };

            return(SkillSet.From(null, new SkillSetOptions(preferredLocale), skill1).First());
        }
        public void MissingPreferredNameReturnsFirstName()
        {
            var skill1 = new SkillSummary
            {
                SkillId      = "skill1",
                Stage        = SkillStage.Development,
                NameByLocale = new Dictionary <string, string>
                {
                    { "en-GB", "british" },
                    { "de-DE", "german" }
                }
            };
            var skillSet = SkillSet.From(null, skill1).First();

            Assert.Equal("british", skillSet.Name);
        }