public async Task JoinTeam_MemberName_ReturnsTrue(string memberName, bool asObserver) { var teamResult = PlanningPokerData.GetTeamResult(); var target = CreateController(teamResult: teamResult); var result = await target.JoinTeam(PlanningPokerData.TeamName, memberName, asObserver); Assert.IsTrue(result); }
public async Task JoinTeam_ServiceReturnsTeam_NavigatesToPlanningPoker() { var teamResult = PlanningPokerData.GetTeamResult(); var navigationManager = new Mock <INavigationManager>(); var target = CreateController(navigationManager: navigationManager.Object, teamResult: teamResult); await target.JoinTeam(PlanningPokerData.TeamName, PlanningPokerData.ObserverName, true); navigationManager.Verify(o => o.NavigateTo("PlanningPoker/Test%20team/Test%20observer")); }
public async Task JoinTeam_ServiceReturnsTeam_InitializePlanningPokerController() { var teamResult = PlanningPokerData.GetTeamResult(); var planningPokerInitializer = new Mock <IPlanningPokerInitializer>(); var target = CreateController(planningPokerInitializer: planningPokerInitializer.Object, teamResult: teamResult); var result = await target.JoinTeam(PlanningPokerData.TeamName, PlanningPokerData.MemberName, false); planningPokerInitializer.Verify(o => o.InitializeTeam(teamResult, PlanningPokerData.MemberName)); }
public async Task CreateTeam_TeamNameAndScrumMasterName_ReturnTrue() { var scrumTeam = PlanningPokerData.GetInitialScrumTeam(); var teamResult = PlanningPokerData.GetTeamResult(scrumTeam); var target = CreateController(teamResult: teamResult); var result = await target.CreateTeam(PlanningPokerData.TeamName, PlanningPokerData.ScrumMasterName, Deck.Standard); Assert.IsTrue(result); }
public async Task CreateTeam_ServiceReturnsTeam_NavigatesToPlanningPoker() { var scrumTeam = PlanningPokerData.GetInitialScrumTeam(); var teamResult = PlanningPokerData.GetTeamResult(scrumTeam); var navigationManager = new Mock <INavigationManager>(); var target = CreateController(navigationManager: navigationManager.Object, teamResult: teamResult); await target.CreateTeam(PlanningPokerData.TeamName, PlanningPokerData.ScrumMasterName, Deck.Standard); navigationManager.Verify(o => o.NavigateTo("PlanningPoker/Test%20team/Test%20Scrum%20Master")); }
public async Task CreateTeam_ServiceReturnsTeam_InitializePlanningPokerController() { var scrumTeam = PlanningPokerData.GetInitialScrumTeam(); var teamResult = PlanningPokerData.GetTeamResult(scrumTeam); var planningPokerInitializer = new Mock <IPlanningPokerInitializer>(); var target = CreateController(planningPokerInitializer: planningPokerInitializer.Object, teamResult: teamResult); await target.CreateTeam(PlanningPokerData.TeamName, PlanningPokerData.ScrumMasterName, Deck.Standard); planningPokerInitializer.Verify(o => o.InitializeTeam(teamResult, PlanningPokerData.ScrumMasterName)); }
public async Task JoinTeam_MemberName_JoinTeamOnService(string memberName, bool asObserver) { var teamResult = PlanningPokerData.GetTeamResult(); var planningPokerService = new Mock <IPlanningPokerClient>(); planningPokerService.Setup(o => o.JoinTeam(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <bool>(), It.IsAny <CancellationToken>())) .ReturnsAsync(teamResult); var target = CreateController(planningPokerService: planningPokerService.Object); await target.JoinTeam(PlanningPokerData.TeamName, memberName, asObserver); planningPokerService.Verify(o => o.JoinTeam(PlanningPokerData.TeamName, memberName, asObserver, It.IsAny <CancellationToken>())); planningPokerService.Verify(o => o.ReconnectTeam(PlanningPokerData.TeamName, memberName, It.IsAny <CancellationToken>()), Times.Never()); }
public async Task CreateTeam_TeamName_CreateTeamOnService(Deck deck) { var scrumTeam = PlanningPokerData.GetInitialScrumTeam(); var teamResult = PlanningPokerData.GetTeamResult(scrumTeam); var planningPokerService = new Mock <IPlanningPokerClient>(); planningPokerService.Setup(o => o.CreateTeam(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <Deck>(), It.IsAny <CancellationToken>())) .ReturnsAsync(teamResult); var target = CreateController(planningPokerService: planningPokerService.Object); await target.CreateTeam(PlanningPokerData.TeamName, PlanningPokerData.ScrumMasterName, deck); planningPokerService.Verify(o => o.CreateTeam(PlanningPokerData.TeamName, PlanningPokerData.ScrumMasterName, deck, It.IsAny <CancellationToken>())); }
public async Task JoinTeam_TeamName_ShowsBusyIndicator() { var planningPokerService = new Mock <IPlanningPokerClient>(); var busyIndicatorService = new Mock <IBusyIndicatorService>(); var joinTeamTask = new TaskCompletionSource <TeamResult>(); planningPokerService.Setup(o => o.JoinTeam(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <bool>(), It.IsAny <CancellationToken>())) .Returns(joinTeamTask.Task); var busyIndicatorInstance = new Mock <IDisposable>(); busyIndicatorService.Setup(o => o.Show()).Returns(busyIndicatorInstance.Object); var target = CreateController(planningPokerService: planningPokerService.Object, busyIndicatorService: busyIndicatorService.Object); var result = target.JoinTeam(PlanningPokerData.TeamName, PlanningPokerData.ObserverName, true); busyIndicatorService.Verify(o => o.Show()); busyIndicatorInstance.Verify(o => o.Dispose(), Times.Never()); joinTeamTask.SetResult(PlanningPokerData.GetTeamResult()); await result; busyIndicatorInstance.Verify(o => o.Dispose()); }
public async Task CreateTeam_TeamName_ShowsBusyIndicator() { var planningPokerService = new Mock <IPlanningPokerClient>(); var busyIndicatorService = new Mock <IBusyIndicatorService>(); var createTeamTask = new TaskCompletionSource <TeamResult>(); planningPokerService.Setup(o => o.CreateTeam(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <Deck>(), It.IsAny <CancellationToken>())) .Returns(createTeamTask.Task); var busyIndicatorInstance = new Mock <IDisposable>(); busyIndicatorService.Setup(o => o.Show()).Returns(busyIndicatorInstance.Object); var target = CreateController(planningPokerService: planningPokerService.Object, busyIndicatorService: busyIndicatorService.Object); var result = target.CreateTeam(PlanningPokerData.TeamName, PlanningPokerData.ScrumMasterName, Deck.Standard); busyIndicatorService.Verify(o => o.Show()); busyIndicatorInstance.Verify(o => o.Dispose(), Times.Never()); createTeamTask.SetResult(PlanningPokerData.GetTeamResult(PlanningPokerData.GetInitialScrumTeam())); await result; busyIndicatorInstance.Verify(o => o.Dispose()); }