public void TestInitialize() { this.webService = WebApp.Start <Startup>("http://*:80/"); this.goClient = new GOClient(@"http://localhost/", "Alberto", "1234"); string connectionString = ConfigurationManager.AppSettings["StorageConnectionString"]; string userTable = ConfigurationManager.AppSettings["UserTableName"]; this.storage = new UserTableStorage(connectionString, userTable); }
public void TestInitialize() { string frontendEndpoint = ConfigurationManager.AppSettings["FrontendTestEndpoint"]; this.goClient = new GOClient(frontendEndpoint, "Alberto", "1234"); string connectionString = ConfigurationManager.AppSettings["StorageConnectionString"]; string userTable = ConfigurationManager.AppSettings["UserTableName"]; this.storage = new UserTableStorage(connectionString, userTable); }
public NewsPusher() { string username = ConfigurationManager.AppSettings["NewsFinderWorkerRoleUsername"]; string password = ConfigurationManager.AppSettings["NewsFinderWorkerRolePassword"]; this.client = new GOClient( ConfigurationManager.AppSettings["GoingOnEndpoint"], username, password); this.client.CreateUser(new UserClient { Nickname = username, Password = password, City = "Malaga", Name = "Fedzilla", Email = "*****@*****.**" }).Wait(); }
public void TestDeleteNewsFromAnotherUser() { var anotherGoClient = new GOClient(@"http://localhost:80/", "NotAlberto", "1234"); var anotherUser = new UserClient { Nickname = "NotAlberto", Password = "******" }; anotherGoClient.CreateUser(anotherUser).Wait(); var createResponse = this.goClient.CreateNews(City, Date, newsClient).Result; var newsUri = createResponse.Headers.Location; var guid = newsUri.AbsolutePath.Split('/').Last(); anotherGoClient.DeleteNews(City, Date, guid).Wait(); Assert.IsTrue(this.newsStorage.Exists(City, DateTime.Parse(Date), Guid.Parse(guid)).Result); }
public void TestDeleteNewsFromAnotherUser() { string frontendEndpoint = ConfigurationManager.AppSettings["FrontendTestEndpoint"]; var anotherGoClient = new GOClient(frontendEndpoint, "NotAlberto", "1234"); var anotherUser = new UserClient { Nickname = "NotAlberto", Password = "******" }; anotherGoClient.CreateUser(anotherUser).Wait(); var createResponse = this.goClient.CreateNews(City, Date, newsClient).Result; var newsUri = createResponse.Headers.Location; var guid = newsUri.AbsolutePath.Split('/').Last(); anotherGoClient.DeleteNews(City, Date, guid).Wait(); Assert.IsTrue(this.newsStorage.Exists(City, DateTime.Parse(Date), Guid.Parse(guid)).Result); }