public void TestCreate() { Assert.IsNotNull(Settings.Secret); var key = new APIKey(); key.Save(); Assert.IsNotNull(key.Id); Assert.IsNotNull(key.Secret); }
public void TestNoMine() { Settings.Configure(null); var key = new APIKey(); key.Save(); Settings.Configure(key.Secret); var mp = Marketplace.Mine; }
public void TestDelete() { Settings.Configure(null); var key = new APIKey(); key.Save(); Settings.Configure(key.Secret); key = new APIKey(); key.Save(); Assert.AreEqual(2, APIKey.Query.total); key.Delete(); Assert.AreEqual(1, APIKey.Query.total); }
public void TestCreateAnonymous() { Settings.Configure(null); var key = new APIKey(); key.Meta["test"] = "this"; key.Save(); Assert.IsNotNull(key.Id); Assert.IsNotNull(key.Secret); var meta = new Dictionary <string, string> { { "test", "this" } }; CollectionAssert.AreEqual(key.Meta, meta); }
public void TestMine() { Settings.Configure(null); var key = new APIKey(); key.Save(); Settings.Configure(key.Secret); var mp = new Marketplace(); Assert.IsNull(mp.id); mp.Save(); Assert.AreEqual(mp.id, Marketplace.Mine.id); }
public void TestCreate() { Settings.Configure(null); var key = new APIKey(); key.Save(); Settings.Configure(key.Secret); var mp = new Marketplace(); Assert.IsNull(mp.id); mp.Save(); Assert.IsNotNull(mp.id); }
public void TestAll() { Settings.Configure(null); var key1 = new APIKey(); key1.Save(); Settings.Configure(key1.Secret); var key2 = new APIKey(); key2.Save(); var key3 = new APIKey(); key3.Save(); IList <APIKey> keys = APIKey.Query.All(); var expectedKeyIds = keys.Select(v => v.Id).ToList(); var keyIds = keys.Select(v => v.Id).ToList(); CollectionAssert.AreEqual(expectedKeyIds, keyIds); }