public async Task CreateTeam_TeamAndScrumMasterName_ReturnsScrumTeam() { await using var fixture = new PlanningPokerSignalRClientFixture(); var resultTask = fixture.Target.CreateTeam(PlanningPokerData.TeamName, PlanningPokerData.ScrumMasterName, Deck.Standard, fixture.CancellationToken); var sentMessage = await fixture.GetSentMessage(); var invocationId = GetInvocationId(sentMessage); var scrumTeam = PlanningPokerData.GetScrumTeam(); var teamResult = PlanningPokerData.GetTeamResult(scrumTeam); var returnMessage = new CompletionMessage(invocationId, null, teamResult, true); await fixture.ReceiveMessage(returnMessage); var result = await resultTask; Assert.AreEqual(teamResult, result); AssertAvailableEstimations(result.ScrumTeam); }
public async Task JoinTeam_TeamAndMemberName_ReturnsScrumTeamWithEstimationInProgress() { await using var fixture = new PlanningPokerSignalRClientFixture(); var resultTask = fixture.Target.JoinTeam(PlanningPokerData.TeamName, PlanningPokerData.MemberName, false, fixture.CancellationToken); var sentMessage = await fixture.GetSentMessage(); var invocationId = GetInvocationId(sentMessage); var estimationParticipants = PlanningPokerData.GetEstimationParticipants(); var scrumTeam = PlanningPokerData.GetScrumTeam(member: true, state: TeamState.EstimationInProgress, estimationParticipants: estimationParticipants); var teamResult = PlanningPokerData.GetTeamResult(scrumTeam); var returnMessage = new CompletionMessage(invocationId, null, teamResult, true); await fixture.ReceiveMessage(returnMessage); var result = await resultTask; Assert.AreEqual(teamResult, result); AssertAvailableEstimations(result.ScrumTeam); }
public async Task JoinTeam_TeamNameAndMemberName_InvocationMessageIsSent() { await using var fixture = new PlanningPokerSignalRClientFixture(); var resultTask = fixture.Target.JoinTeam(PlanningPokerData.TeamName, PlanningPokerData.MemberName, false, fixture.CancellationToken); var sentMessage = await fixture.GetSentMessage(); var sentInvocationMessage = AssertIsInvocationMessage(sentMessage); Assert.AreEqual("JoinTeam", sentInvocationMessage.Target); var expectedArguments = new object[] { PlanningPokerData.TeamName, PlanningPokerData.MemberName, false }; CollectionAssert.AreEqual(expectedArguments, sentInvocationMessage.Arguments); var scrumTeam = PlanningPokerData.GetScrumTeam(member: true); var teamResult = PlanningPokerData.GetTeamResult(scrumTeam); var returnMessage = new CompletionMessage(sentInvocationMessage.InvocationId, null, teamResult, true); await fixture.ReceiveMessage(returnMessage); await resultTask; }
public async Task JoinTeam_TeamAndMemberName_ReturnsScrumTeamWithEstimationCanceled() { await using var fixture = new PlanningPokerSignalRClientFixture(); var resultTask = fixture.Target.JoinTeam(PlanningPokerData.TeamName, PlanningPokerData.MemberName, false, fixture.CancellationToken); var sentMessage = await fixture.GetSentMessage(); var invocationId = GetInvocationId(sentMessage); var estimationResult = PlanningPokerData.GetEstimationResult(scrumMasterEstimation: 0, memberEstimation: double.NaN); var scrumTeam = PlanningPokerData.GetScrumTeam(member: true, state: TeamState.EstimationCanceled, estimationResult: estimationResult); var teamResult = PlanningPokerData.GetTeamResult(scrumTeam); var returnMessage = new CompletionMessage(invocationId, null, teamResult, true); await fixture.ReceiveMessage(returnMessage); var result = await resultTask; Assert.AreEqual(teamResult, result); AssertAvailableEstimations(result.ScrumTeam); Assert.AreEqual(0.0, result.ScrumTeam.EstimationResult[0].Estimation.Value); Assert.IsNull(result.ScrumTeam.EstimationResult[1].Estimation); }