Exemplo n.º 1
0
        public void TestCreate()
        {
            Assert.IsNotNull(Settings.Secret);

            APIKey key = new APIKey();
            key.Save();
            Assert.IsNotNull(key.Id);
            Assert.IsNotNull(key.Secret);
        }
Exemplo n.º 2
0
        public void TestNoMine()
        {
            Settings.configure(null);

            var key = new APIKey();
            key.Save();
            Settings.configure(key.Secret);

            var mp = Marketplace.Mine;
        }
Exemplo n.º 3
0
        public void TestDelete()
        {
            Settings.configure(null);

            APIKey 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);
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
        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);
        }
Exemplo n.º 6
0
        public void TestCreateAnonymous()
        {
            Settings.configure(null);

            APIKey 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);
        }
Exemplo n.º 7
0
        public void TestAll()
        {
            Settings.configure(null);

            APIKey key1 = new APIKey();
            key1.Save();
            Settings.configure(key1.Secret);

            APIKey key2 = new APIKey();
            key2.Save();

            APIKey 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);
        }