public RequestFacade(ILobbyController lobbyController, IGameController gameController) { _serviceTypeToRequestHandlers = new Dictionary <SocketServiceType, Func <SocketBase, Task> > { { SocketServiceType.User, lobbyController.HandleRequest }, { SocketServiceType.Game, gameController.HandleRequest } }; }
public void Setup() { container = LobbyContainer.GetInstance(); accountController = new AccountControllerMock(); controller = new LobbyController(container, accountController); lobby = new Lobby() { Id = Guid.NewGuid(), Limit = 3, Players = new List <Account>(), }; account = new Account() { Id = Guid.NewGuid(), }; container.Add(lobby); accountController.InsertAccount(account); }
public Player( ILobbyController controller, IMatch match, int number, string name, IRole role, CultureInfo culture = null) { Alive = true; Match = match; Number = number; Id = controller.Id; Color = PlayerColorsExtensions.From(number).Color(); Name = new Text(new[] { new Content(name, Color) }, Color.Empty); Role = role; LastWill = new Note(Match, this); DeathNote = new Note(Match, this); Crimes = new Crimes(this); Controller = controller.Player(this); Culture = culture ?? new CultureInfo("en-US"); Targets = new TargetManager(this); }
public void Setup() { // setup testserver _server = new TestServer(new WebHostBuilder() .UseStartup <StartupIntegrationTest1>()); _server.Host.Start(); _client = _server.CreateClient(); //creating domain objects should these be fakes ´??? ILobby testLobby = Substitute.For <ILobby>(); testLobby.Id = "DenseLobby"; testLobby.AdminUserName = "******"; _pers2.Username = "******"; _pers2.GivenName = "Patrick"; _pers2.LastName = "Per"; _pers2.Password = "******"; _pers2.Email = "*****@*****.**"; _pers.Username = "******"; _pers.GivenName = "Max"; _pers.LastName = "Imilian"; _pers.Password = "******"; _pers.Email = "*****@*****.**"; //Fakes Setup StartupIntegrationTest1.FakeLoginManager.CheckLoginStatus(Arg.Any <string>(), Arg.Any <string>()).Returns(true); StartupIntegrationTest1.FakeLobbyController.CreateLobbyAsync(Arg.Any <string>(), Arg.Any <string>()).Returns(testLobby); StartupIntegrationTest1.FakeLobbyController.JoinLobbyAsync(Arg.Any <string>(), Arg.Any <string>()).Returns(testLobby); StartupIntegrationTest1.FakeLobbyController.LeaveLobbyAsync(Arg.Any <string>(), Arg.Any <string>()).Returns(true); fakeUserController = StartupIntegrationTest1.FakeUserController; fakeLobbyController = StartupIntegrationTest1.FakeLobbyController; }
public DinnergeddonService() { accountController = new AccountController(); lobbyController = new LobbyController(LobbyContainer.GetInstance(), accountController); highscoreController = new HighscoreController(); }
public ILobbyView CreateLobbyView(IMainController mainController, ILobbyController lobbyController) { return(new frmLobby(mainController, lobbyController)); }
public static List <string> IdsExcept(this ILobby lobby, ILobbyController except) { return(lobby.Except(except) .Select(controller => controller.Id.ToString()) .ToList()); }
public void Setup() { container = new LobbyContainerMock(); controller = new LobbyController(container, new AccountControllerMock()); }
public void SetOnGameStateCallback(ILobbyController lobby) { _lobby = lobby; }
public IEnumerable <ILobbyController> Except(ILobbyController except) { return(Controllers.Where(controller => controller != except)); }
public LobbiesHub() { lobbyController = new LobbyController(LobbyContainer.GetInstance(), new AccountController()); }
public frmLobby(IMainController mainController, ILobbyController lobbyController) { _mainController = mainController; _lobbyController = lobbyController; InitializeComponent(); }