Ejemplo n.º 1
0
        public void Setup()
        {
            this.userRepo      = new Mock <IUserRepository>();
            this.userMatchRepo = new Mock <IUserMatchRepository>();
            this.matchRepo     = new Mock <IMatchRepository>();

            this.serviceUnderTest = new NumberGameService(matchRepo.Object, userMatchRepo.Object, userRepo.Object);

            this.matches = new List <Entities.Match>()
            {
                new Entities.Match
                {
                    MatchId    = 1,
                    ExpiryDate = DateTime.Now.AddMinutes(10)
                },
                new Entities.Match
                {
                    MatchId    = 2,
                    ExpiryDate = DateTime.Now.AddMinutes(-10)
                }
            };


            this.users = new List <Entities.User>()
            {
                new Entities.User
                {
                    Id       = 1,
                    Password = String.Empty,
                    UserName = "******"
                },
                new Entities.User
                {
                    Id       = 2,
                    Password = String.Empty,
                    UserName = "******"
                },
                new Entities.User
                {
                    Id       = 3,
                    Password = String.Empty,
                    UserName = "******"
                },
                new Entities.User
                {
                    Id       = 4,
                    Password = String.Empty,
                    UserName = "******"
                }
            };
        }
Ejemplo n.º 2
0
 public NumberGameController(INumberGameService _service, ILogger <NumberGameController> _logger)
 {
     this.service = _service;
     this.logger  = _logger;
 }