public void OnTestSetup()
 {
     string pass;
     _host = new ServiceTestAppHost();
     _host.Init();
     _host.Start(ServiceTestAppHost.BaseUrl);
     _client = new JsonServiceClient(ServiceTestAppHost.BaseUrl);
     _testUser = DbDataGenerator.AddUserToDatabase(out pass);
     _client.Post(new Auth {provider = "credentials", UserName = _testUser.Email, Password = pass});
 }
 public void OnTestSetup()
 {
     _host = new ServiceTestAppHost();
     _host.Init();
     _host.Start(ServiceTestAppHost.BaseUrl);
     _client = new JsonServiceClient(ServiceTestAppHost.BaseUrl);
     IocBox.Kernel = new StandardKernel(new RealDomainModule(), new RealInfrastructureModule());
     string pass;
     _testUser = DbDataGenerator.AddUserToDatabase(out pass);
     _testBlueprint = DbDataGenerator.AddBlueprintToDatabase(_testUser.Id);
     _client.Send(new Auth {UserName = _testUser.Email, Password = pass});
 }
Exemple #3
0
 public static User CreateNewUser(string firstName, string lastName, string email, string password)
 {
     using (var uow = new UserUnitOfWork())
     {
         var user = uow.Users.FirstOrDefault(u => u.Email == email);
         if (user != null)
         {
             return null;
         }
         user = new User(firstName, lastName, email, password);
         uow.Users.Add(user);
         uow.Save();
         return user;
     }
 }
 private void UserEquals(User expected, UserResponse actual)
 {
     Assert.IsNotNull(actual);
     Assert.AreEqual(expected.Email, actual.Email);
     Assert.AreEqual(expected.FirstName, actual.FirstName);
     Assert.AreEqual(expected.LastName, actual.LastName);
 }