public void SetUp() { Console.WriteLine("Setting up"); if (app == null) { app = new KZApplication(Constants.marketplace, Constants.application, Constants.applicationKey); app.Initialize().Wait(); app.Authenticate(Constants.user, Constants.pass, Constants.provider).Wait(); } if (queryDataSrc == null) { queryDataSrc = app.DataSource["GetCityWeather"]; } if (invokeDataSrc == null) { invokeDataSrc = app.DataSource["InvokeCityWeather"]; } if (queryWithData == null) { queryWithData = app.DataSource["GetCityWeather"]; } if (invokeWithData == null) { invokeWithData = app.DataSource["InvokeCityWeather"]; } }
public async Task Delete() { var app = new KZApplication(test.Constants.MarketplaceUrl, test.Constants.AppName); await app.Initialize(); var user = await app.Authenticate(test.Constants.User, test.Constants.Password, test.Constants.Provider); var files = app.Files; var uploadResult = await files.Upload(file, "/foo.txt"); var result = await files.Browse("/"); Assert.AreEqual(1, result.Data.files .Where(f => f.name == "foo.txt") .Count()); var delResult = await files.Delete("/foo.txt"); Assert.AreEqual(HttpStatusCode.NoContent, delResult.StatusCode); Assert.IsTrue(delResult.Data); result = await files.Browse("/"); Assert.AreEqual(0, result.Data.files .Where(f => f.name == "foo.txt") .Count()); EnqueueTestComplete(); }
public async Task CanAuthenticateanUserUsing() { var user = await app.Authenticate(test.Constants.User, test.Constants.Password, test.Constants.Provider); Assert.IsNotNull(user); Assert.IsNotNull(user.TokenApplication); Assert.IsNotNull(user.TokenMarketplace); EnqueueTestComplete(); }
public async void ShouldAuthenticate() { var app = new KZApplication(Constants.marketplace, Constants.application); await app.Initialize(); var t = app.Authenticate(Constants.user, Constants.pass, Constants.provider); await t.ContinueWith((r) => { Assert.IsNotNull(r.Result.TokenMarketplace); }); }
static public async Task ClassInit(TestContext context) #endif { app = new KZApplication(test.Constants.MarketplaceUrl, test.Constants.AppName); await app.Initialize(); var user = await app.Authenticate(test.Constants.User, test.Constants.Password, test.Constants.Provider); service = app.Service["echo"]; EnqueueTestComplete(); }
private async Task InitApplication() { if (app == null) { app = new KZApplication(Constants.marketplace, Constants.application); await app.Initialize(); await app.Authenticate(Constants.user, Constants.pass, Constants.provider); } await InitStorage(); }
public void ShouldAuthenticate() { //arrange var app = new KZApplication(Constants.marketplace, Constants.application, Constants.applicationKey); app.Initialize().Wait(); //act var user = app.Authenticate(Constants.user, Constants.pass, Constants.provider).Result; //assert Assert.IsNotNull(user.TokenMarketplace); Assert.AreEqual(true, app.Authenticated); }
public void SetUp() { Console.WriteLine("Setting up"); if (app == null) { app = new KZApplication(Constants.marketplace, Constants.application, Constants.applicationKey); app.Initialize().Wait(); app.Authenticate(Constants.user, Constants.pass, Constants.provider).Wait(); } if (sms == null) { sms = app.SmsSender["+13053038639"]; } }
public void SetUp() { Console.WriteLine("Setting up"); if (app == null) { app = new KZApplication(Constants.marketplace, Constants.application, Constants.applicationKey); app.Initialize().Wait(); app.Authenticate(Constants.user, Constants.pass, Constants.provider).Wait(); } if (queue == null) { queue = app.Queue["foo"]; } }
static public async Task ClassInit(TestContext context) #endif { var bytes = UTF8Encoding.UTF8.GetBytes("sample file"); file = new MemoryStream(); file.Write(bytes, 0, bytes.Length); file.Flush(); app = new KZApplication(test.Constants.MarketplaceUrl, test.Constants.AppName); await app.Initialize(); var user = await app.Authenticate(test.Constants.User, test.Constants.Password, test.Constants.Provider); files = app.Files; EnqueueTestComplete(); }
public void SetUp() { Console.WriteLine("Setting up"); if (app == null) { app = new KZApplication(Constants.marketplace, Constants.application, Constants.applicationKey); app.Initialize().Wait(); app.Authenticate(Constants.user, Constants.pass, Constants.provider).Wait(); } if (logging == null) { logging = app.Logger; } logging.Write("foo", LogLevel.LogLevelVerbose).Wait(); logging.Clear().Wait(); }
public async void Subscribe() { var app = new KZApplication(Constants.marketplace, Constants.application); await app.Initialize(); var user = await app.Authenticate(Constants.user, Constants.pass, Constants.provider); var channel = app.PubSubChannel ["pubsubchanneltest"]; var rnd = Guid.NewGuid().ToString(); channel.Susbscribe <ChannelMessage> (msg => { Assert.Equals(rnd, msg.value); autoEvent.Set(); }, err => { if (err != null) { Assert.Fail(); } }); var message = new ChannelMessage { value = rnd }; var response = channel.Publish(message); //Assert.AreEqual(HttpStatusCode.Created, response.Result.StatusCode); if (autoEvent.WaitOne(60000)) { Assert.True(1 == 1); } else { Assert.Fail(); } }
static public async Task ClassInit(TestContext context) #endif { if (app == null) { app = new KZApplication(Constants.MarketplaceUrl, Constants.AppName); await app.Initialize(); var user = await app.Authenticate(Constants.User, Constants.Password, Constants.Provider); } if (queryDataSrc == null) { queryDataSrc = app.DataSource["test-query"]; } if (invokeDataSrc == null) { invokeDataSrc = app.DataSource["test-operation"]; } EnqueueTestComplete(); }
public void SetUp() { Console.WriteLine("Setting up"); Stopwatch sw = new Stopwatch(); sw.Start(); if (app == null) { app = new KZApplication(Constants.marketplace, Constants.application, Constants.applicationKey); app.Initialize().Wait(); app.Authenticate(Constants.user, Constants.pass, Constants.provider).Wait(); } sw.Stop(); Console.WriteLine("Elapsed={0}", sw.Elapsed); if (mail == null) { mail = app.MailSender; } }
public void SetUp() { Console.WriteLine("Setting up"); ServicePointManager.ServerCertificateValidationCallback = (x, w, y, z) => true; if (app == null) { app = new KZApplication(Constants.marketplace, Constants.application, Constants.applicationKey); app.Initialize().Wait(); app.Authenticate(Constants.user, Constants.pass, Constants.provider).Wait(); } if (objectSet == null) { objectSet = app.Storage["test-monodroid"]; } //insert just in case the object set doesn't exist objectSet.Insert(new { Foo = "foo" }).Wait(); //drop the object set. var dropResult = objectSet.Drop().Result; Assert.AreEqual(HttpStatusCode.OK, dropResult.StatusCode); }