public RequestFacade(ILobbyController lobbyController, IGameController gameController)
 {
     _serviceTypeToRequestHandlers = new Dictionary <SocketServiceType, Func <SocketBase, Task> >
     {
         { SocketServiceType.User, lobbyController.HandleRequest },
         { SocketServiceType.Game, gameController.HandleRequest }
     };
 }
Exemple #2
0
        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);
        }
Exemple #3
0
 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();
 }
Exemple #6
0
 public ILobbyView CreateLobbyView(IMainController mainController, ILobbyController lobbyController)
 {
     return(new frmLobby(mainController, lobbyController));
 }
Exemple #7
0
 public static List <string> IdsExcept(this ILobby lobby, ILobbyController except)
 {
     return(lobby.Except(except)
            .Select(controller => controller.Id.ToString())
            .ToList());
 }
Exemple #8
0
 public void Setup()
 {
     container  = new LobbyContainerMock();
     controller = new LobbyController(container, new AccountControllerMock());
 }
Exemple #9
0
 public void SetOnGameStateCallback(ILobbyController lobby)
 {
     _lobby = lobby;
 }
Exemple #10
0
 public IEnumerable <ILobbyController> Except(ILobbyController except)
 {
     return(Controllers.Where(controller => controller != except));
 }
Exemple #11
0
 public LobbiesHub()
 {
     lobbyController = new LobbyController(LobbyContainer.GetInstance(), new AccountController());
 }
Exemple #12
0
 public frmLobby(IMainController mainController, ILobbyController lobbyController)
 {
     _mainController  = mainController;
     _lobbyController = lobbyController;
     InitializeComponent();
 }