コード例 #1
0
    public void Name_ShouldReturnDisplayNameOfItem(IBehaviorProfileContext ctx, [Content] Item ctxItem)
    {
      ctx.Id.Returns(ctxItem.ID);
      var model = new BehaviorProfile(ctx);
      model.Name.Should().Be(ctxItem.DisplayName);

    }
コード例 #2
0
    public void NumberOfTimesScored_ShouldReturnFromContext(IBehaviorProfileContext ctx, int count)
    {
      ctx.NumberOfTimesScored.Returns(count);
      var model = new BehaviorProfile(ctx);
      model.NumberOfTimesScored.Should().Be(count);

    }
コード例 #3
0
    public void Id_ShouldReturnFromContext(IBehaviorProfileContext ctx)
    {
      ctx.Id.Returns(ID.NewID);
      var model = new BehaviorProfile(ctx);
      model.Id.Should().Be(ctx.Id.Guid);

    }
コード例 #4
0
 public void Scores_ShouldReturnFromContext(IBehaviorProfileContext ctx, float value, [Content] Item ctxItem)
 {
   var score = new KeyValuePair<ID, float>(ctxItem.ID, value);
   ctx.Scores.Returns(new [] { score });
   var model = new BehaviorProfile(ctx);
   model.Scores.Count().Should().Be(1);
   model.Scores.First().Id.Should().Be(score.Key.Guid);
   model.Scores.First().Value.Should().Be(score.Value);
   model.Scores.First().Name.Should().Be(ctxItem.DisplayName);
 }