Exemplo n.º 1
0
        public virtual SeverityVote AddSeverityVote(User user, int severity)
        {
            var severityVote = new SeverityVote(user, severity);
            ((IList<SeverityVote>) SeverityVotes).Add(severityVote);

            return severityVote;
        }
Exemplo n.º 2
0
 public static UserSession New(User user, DateTime? expires = null)
 {
     return new UserSession
     {
         Id = Guid.NewGuid(),
         User = user,
         Expires = expires ?? DateTime.Now.AddDays(10)
     };
 }
        public static void WithUser(this ConfigurableBootstrapper.ConfigurableBootstrapperConfigurator config, User user)
        {
            var nancyContext = new NancyContext
                                   {
                                       CurrentUser = new FireTowerUserIdentity(user)
                                   };

            var contextFactory = new TestingContextFactory(nancyContext);

            config.ContextFactory(contextFactory);
        }
Exemplo n.º 4
0
        public UserSession Create(User user)
        {
            var userSession = new UserSession
                                  {
                                      Id = _tokenGenerator.Generate(),
                                      User = user,
                                      Expires = _tokenExpirationProvider.GetExpiration(_timeProvider.Now())
                                  };

            _writeableRepository.Create(userSession);

            return userSession;
        }
Exemplo n.º 5
0
        public void Seed()
        {
            var location = new Location {LocationId = 106781442691621, LocationName = "San Pedro Sula, Cortes"};
            _session.Save(new User
                {
                    FirstName = "Byron",
                    LastName = "Sommardahl",
                    Name = "Byron Sommardahl",
                    FacebookId = 1817134138,
                    Locale = "es_ES",
                    Username = "******",
                    Verified = true,
                    Location = location
                });

            var user = new User
                {
                    FirstName = "Test",
                    LastName = "Test",
                    Name = "Test Test",
                    Email = "*****@*****.**",
                    EncryptedPassword = new HashPasswordEncryptor().Encrypt("password").Password,
                    FacebookId = 1937134326,
                    Locale = "es_ES",
                    Username = "******",
                    Verified = true,
                    Location = location
                };
            _session.Save(user);

            _session.Save(new UserSession
                {
                    Expires = DateTime.Now.AddYears(1),
                    User = user,
                    Id = Guid.NewGuid()
                });
        }
Exemplo n.º 6
0
 public SeverityVote(User user, int severity)
 {
     User = user;
     Severity = severity;
 }
Exemplo n.º 7
0
 public PutOutVote(User user, bool isPutOut)
 {
     User = user;
     IsPutOut = isPutOut;
 }
Exemplo n.º 8
0
 public ControlledVote(User user, bool isControlled)
 {
     User = user;
     IsControlled = isControlled;
 }
Exemplo n.º 9
0
 public virtual void addPutOutVote(User user, Guid disasterId, bool isPutOut)
 {
     var putOutVote = new PutOutVote(user, isPutOut);
     ((IList<PutOutVote>) PutOutVotes).Add(putOutVote);
 }
Exemplo n.º 10
0
 public virtual void AddControlledVote(User user, Guid disasterId, bool isControlled)
 {
     var controlledVote = new ControlledVote(user, isControlled);
     ((IList<ControlledVote>) ControlledVotes).Add(controlledVote);
 }
Exemplo n.º 11
0
 public FireTowerUserIdentity(User user)
 {
     User = user;
 }