Exemplo n.º 1
0
        public void Setup()
        {
            gameService       = new Mock <IGameService>();
            timeServiceMock   = new Mock <ITimeService>();
            contestantService = new InMemoryContestantService(gameService.Object, timeServiceMock.Object);
            timeServiceMock.Setup(m => m.Now()).Returns(time1);

            contestant1 = new Contestant("Contestant1", "1234", timeServiceMock.Object.Now(), 0);
            contestantService.AddContestant(contestant1);

            updateController = new UpdateController(contestantService, timeServiceMock.Object, new GameService());
        }
Exemplo n.º 2
0
        public RegisterResponse Post([FromBody] RegisterRequest request)
        {
            var response = new RegisterResponse();

            response.Name  = request.Name;
            response.Token = Guid.NewGuid().ToString();

            contestantService.AddContestant(new Contestant(
                                                response.Name,
                                                response.Token,
                                                timeService.Now(),
                                                0
                                                ));

            return(response);
        }