/// <summary> /// Initializes a new instance of the <see cref="CreateTeamController"/> class. /// </summary> /// <param name="planningPokerService">Planning poker client to create Scrum Team on server.</param> /// <param name="planningPokerInitializer">Objects that initialize new Planning Poker game.</param> /// <param name="messageBoxService">Service to display message to user.</param> /// <param name="busyIndicatorService">Service to display that operation is in progress.</param> /// <param name="uriHelper">Service to navigate to specified URL.</param> public CreateTeamController( IPlanningPokerClient planningPokerService, IPlanningPokerInitializer planningPokerInitializer, IMessageBoxService messageBoxService, IBusyIndicatorService busyIndicatorService, IUriHelper uriHelper) { _planningPokerService = planningPokerService ?? throw new ArgumentNullException(nameof(planningPokerService)); _planningPokerInitializer = planningPokerInitializer ?? throw new ArgumentNullException(nameof(planningPokerInitializer)); _messageBoxService = messageBoxService ?? throw new ArgumentNullException(nameof(messageBoxService)); _busyIndicatorService = busyIndicatorService ?? throw new ArgumentNullException(nameof(busyIndicatorService)); _uriHelper = uriHelper ?? throw new ArgumentNullException(nameof(uriHelper)); }
private static CreateTeamController CreateController( IPlanningPokerInitializer planningPokerInitializer = null, IPlanningPokerClient planningPokerService = null, IMessageBoxService messageBoxService = null, IBusyIndicatorService busyIndicatorService = null, IUriHelper uriHelper = null, ScrumTeam scrumTeam = null, string errorMessage = null) { if (planningPokerInitializer == null) { var planningPokerInitializerMock = new Mock <IPlanningPokerInitializer>(); planningPokerInitializer = planningPokerInitializerMock.Object; } if (planningPokerService == null) { var planningPokerServiceMock = new Mock <IPlanningPokerClient>(); var createSetup = planningPokerServiceMock.Setup(o => o.CreateTeam(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <CancellationToken>())); if (errorMessage == null) { createSetup.ReturnsAsync(scrumTeam); } else { createSetup.ThrowsAsync(new PlanningPokerException(errorMessage)); } planningPokerService = planningPokerServiceMock.Object; } if (messageBoxService == null) { var messageBoxServiceMock = new Mock <IMessageBoxService>(); messageBoxService = messageBoxServiceMock.Object; } if (busyIndicatorService == null) { var busyIndicatorServiceMock = new Mock <IBusyIndicatorService>(); busyIndicatorService = busyIndicatorServiceMock.Object; } if (uriHelper == null) { var uriHelperMock = new Mock <IUriHelper>(); uriHelper = uriHelperMock.Object; } return(new CreateTeamController(planningPokerService, planningPokerInitializer, messageBoxService, busyIndicatorService, uriHelper)); }
private static CreateTeamController CreateController( IPlanningPokerInitializer planningPokerInitializer = null, IPlanningPokerClient planningPokerService = null, IMessageBoxService messageBoxService = null, IBusyIndicatorService busyIndicatorService = null, INavigationManager navigationManager = null, TeamResult teamResult = null, string errorMessage = null) { if (planningPokerInitializer == null) { var planningPokerInitializerMock = new Mock <IPlanningPokerInitializer>(); planningPokerInitializer = planningPokerInitializerMock.Object; } if (planningPokerService == null) { var planningPokerServiceMock = new Mock <IPlanningPokerClient>(); var createSetup = planningPokerServiceMock.Setup(o => o.CreateTeam(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <Deck>(), It.IsAny <CancellationToken>())); if (errorMessage == null) { createSetup.ReturnsAsync(teamResult); } else { createSetup.ThrowsAsync(new PlanningPokerException(errorMessage)); } planningPokerService = planningPokerServiceMock.Object; } if (messageBoxService == null) { var messageBoxServiceMock = new Mock <IMessageBoxService>(); messageBoxService = messageBoxServiceMock.Object; } if (busyIndicatorService == null) { var busyIndicatorServiceMock = new Mock <IBusyIndicatorService>(); busyIndicatorService = busyIndicatorServiceMock.Object; } if (navigationManager == null) { var navigationManagerMock = new Mock <INavigationManager>(); navigationManager = navigationManagerMock.Object; } return(new CreateTeamController(planningPokerService, planningPokerInitializer, messageBoxService, busyIndicatorService, navigationManager)); }
/// <summary> /// Initializes a new instance of the <see cref="JoinTeamController"/> class. /// </summary> /// <param name="planningPokerService">Planning poker client to create Scrum Team on server.</param> /// <param name="planningPokerInitializer">Objects that initialize new Planning Poker game.</param> /// <param name="messageBoxService">Service to display message to user.</param> /// <param name="busyIndicatorService">Service to display that operation is in progress.</param> /// <param name="navigationManager">Service to navigate to specified URL.</param> /// <param name="memberCredentialsStore">Service to save and load member credentials.</param> public JoinTeamController( IPlanningPokerClient planningPokerService, IPlanningPokerInitializer planningPokerInitializer, IMessageBoxService messageBoxService, IBusyIndicatorService busyIndicatorService, INavigationManager navigationManager, IMemberCredentialsStore memberCredentialsStore) { _planningPokerService = planningPokerService ?? throw new ArgumentNullException(nameof(planningPokerService)); _planningPokerInitializer = planningPokerInitializer ?? throw new ArgumentNullException(nameof(planningPokerInitializer)); _messageBoxService = messageBoxService ?? throw new ArgumentNullException(nameof(messageBoxService)); _busyIndicatorService = busyIndicatorService ?? throw new ArgumentNullException(nameof(busyIndicatorService)); _navigationManager = navigationManager ?? throw new ArgumentNullException(nameof(navigationManager)); _memberCredentialsStore = memberCredentialsStore ?? throw new ArgumentNullException(nameof(memberCredentialsStore)); }
private static JoinTeamController CreateController( IPlanningPokerInitializer planningPokerInitializer = null, IPlanningPokerClient planningPokerService = null, IMessageBoxService messageBoxService = null, IBusyIndicatorService busyIndicatorService = null, IUriHelper uriHelper = null, IMemberCredentialsStore memberCredentialsStore = null, bool memberExistsError = false, ScrumTeam scrumTeam = null, ReconnectTeamResult reconnectTeamResult = null, string errorMessage = null, MemberCredentials memberCredentials = null) { if (planningPokerInitializer == null) { var planningPokerInitializerMock = new Mock <IPlanningPokerInitializer>(); planningPokerInitializer = planningPokerInitializerMock.Object; } if (planningPokerService == null) { var planningPokerServiceMock = new Mock <IPlanningPokerClient>(); var joinSetup = planningPokerServiceMock.Setup(o => o.JoinTeam(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <bool>(), It.IsAny <CancellationToken>())); var reconnectSetup = planningPokerServiceMock.Setup(o => o.ReconnectTeam(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <CancellationToken>())); if (memberExistsError) { joinSetup.ThrowsAsync(new PlanningPokerException(ReconnectErrorMessage)); if (errorMessage == null) { reconnectSetup.ReturnsAsync(reconnectTeamResult); } else { reconnectSetup.ThrowsAsync(new PlanningPokerException(errorMessage)); } } else { if (errorMessage == null) { joinSetup.ReturnsAsync(scrumTeam); } else { joinSetup.ThrowsAsync(new PlanningPokerException(errorMessage)); } } planningPokerService = planningPokerServiceMock.Object; } if (messageBoxService == null) { var messageBoxServiceMock = new Mock <IMessageBoxService>(); if (memberExistsError) { SetupReconnectMessageBox(messageBoxServiceMock, true); } messageBoxService = messageBoxServiceMock.Object; } if (busyIndicatorService == null) { var busyIndicatorServiceMock = new Mock <IBusyIndicatorService>(); busyIndicatorService = busyIndicatorServiceMock.Object; } if (uriHelper == null) { var uriHelperMock = new Mock <IUriHelper>(); uriHelper = uriHelperMock.Object; } if (memberCredentialsStore == null) { var memberCredentialsStoreMock = new Mock <IMemberCredentialsStore>(); memberCredentialsStoreMock.Setup(o => o.GetCredentialsAsync()).ReturnsAsync(memberCredentials); memberCredentialsStore = memberCredentialsStoreMock.Object; } return(new JoinTeamController(planningPokerService, planningPokerInitializer, messageBoxService, busyIndicatorService, uriHelper, memberCredentialsStore)); }