public void ExecuteGivenAs_ShouldUseCorrectAbility(ActionExecuteGiven sut, Mock <IActor> actor, TestAbility expected) { //arrange //act sut.ExecuteGivenAs(actor.Object, expected); //assert Assert.Equal(expected, sut.Ability); }
public void ExecuteGivenAs_ShouldCallActorExecute([Frozen] IAction <Unit> expected, ActionExecuteGiven sut, Mock <IActor> actor) { //arrange //act sut.ExecuteGivenAs(actor.Object); //assert actor.Verify(a => a.Execute(expected)); }
public void ExecuteGivenAs_ShouldUseCorrectActor(ActionExecuteGiven sut, Mock <IActor> actor, TestAbility ability) { //arrange var expected = actor.Object; //act sut.ExecuteGivenAs(actor.Object, ability); //assert Assert.Equal(expected, sut.Actor); }
public void ExecuteGivenAs_WhenSutIsActionUnit_ShouldCallActorExecute(ActionExecuteGiven sut, Mock <IActor> actor) { //arrange //act sut.ExecuteGivenAs(actor.Object); //assert #pragma warning disable CS0618 // Type or member is obsolete actor.Verify(a => a.ExecuteWithAbility(sut)); #pragma warning restore CS0618 // Type or member is obsolete }
public void ExecuteGivenAs_ShouldCallActorExecute( [Frozen] IAction <object> action, ActionExecuteGiven sut, Mock <IActor> actor, object expected) { //arrange actor.Setup(a => a.Execute(action)).Returns(expected); //act var actual = sut.ExecuteGivenAs(actor.Object); //assert Assert.Equal(expected, actual); }