public void GetSkillIndex_returns_zero_if_programmer_has_no_skills() { var id = "id"; var networkRepository = Substitute.For <INetworkRepository>(); networkRepository.GetById(id).Returns(new Programmer(id, null, new string[] { })); var skillsService = new SkillsService(networkRepository); var skillIndex = skillsService.GetSkillIndex(id, "skill"); Assert.That(skillIndex, Is.EqualTo(0)); }
public void GetSkillIndex_returns_one_based_index_of_given_skill() { var id = "id"; var networkRepository = Substitute.For <INetworkRepository>(); networkRepository.GetById(id).Returns(new Programmer(id, null, new[] { "other skill", "skill" })); var skillsService = new SkillsService(networkRepository); var skillIndex = skillsService.GetSkillIndex(id, "skill"); Assert.That(skillIndex, Is.EqualTo(2)); }
public void GetSkillRank_returns_zero_if_programmer_does_not_have_given_skill() { var id = "id"; var networkRepository = Substitute.For <INetworkRepository>(); networkRepository.GetById(id).Returns(new Programmer(id, null, new [] { "other skill" })); var skillsService = new SkillsService(networkRepository); var skillRank = skillsService.GetSkillIndex(id, "skill"); Assert.That(skillRank, Is.EqualTo(0)); }