public void TestGetSkills(SkillListing listing) { var skills = listing.GetSkills(); var hasVariants = listing.Variants.Any(); var expectedCount = hasVariants ? listing.Variants.Count : 1; Assert.That(skills.Count, Is.EqualTo(expectedCount)); foreach (var skill in skills) { Assert.That(skill.BaseKey, Is.EqualTo(listing.Key)); Assert.That(skill.BaseName, Is.EqualTo(listing.Name)); Assert.That(skill.Ability, Is.EqualTo(listing.Ability)); } if (hasVariants) { var actualVariants = from s in skills select s.Variant; Assert.That(actualVariants, Is.EquivalentTo(listing.Variants)); } else { Assert.That(skills.First().Variant, Is.EqualTo(string.Empty)); } }
public SkillListingViewModel(SkillListing skillListing) { _skillListing = skillListing; }