public void AddSkill_AddsBlankSkill()
        {
            //Arrange
            var blankSkill = new Skill
            {
                ArmourCheckPenalty    = 0,
                HasArmourCheckPenalty = false,
                Name          = "",
                PrimaryStatId = AbilityType.Str,
                Ranks         = 0,
                Class         = false,
                UseUntrained  = true
            };

            //Act
            _skillTableModel.AddSkill();

            //Assert
            A.CallTo(() => _skillsService.AddSkill(A <Skill> .That.Matches(s =>
                                                                           s.ArmourCheckPenalty == blankSkill.ArmourCheckPenalty &&
                                                                           s.HasArmourCheckPenalty == blankSkill.HasArmourCheckPenalty &&
                                                                           s.Name == blankSkill.Name &&
                                                                           s.PrimaryStatId == blankSkill.PrimaryStatId &&
                                                                           s.Ranks == blankSkill.Ranks &&
                                                                           s.UseUntrained == blankSkill.UseUntrained))).MustHaveHappened();
        }
Example #2
0
 public void AddSkill()
 {
     _skillsService.AddSkill(new Skill
     {
         Id = Guid.NewGuid(),
         ArmourCheckPenalty    = 0,
         HasArmourCheckPenalty = false,
         Name          = "",
         PrimaryStatId = AbilityType.Str,
         Ranks         = 0,
         Class         = false,
         UseUntrained  = true
     });
 }
Example #3
0
 public JsonResult AddSkill(SkillViewModel skill)
 {
     _skillsService.AddSkill(Mapper.Map(skill));
     return(Json("OK"));
 }