Exemplo n.º 1
0
        /// <summary>
        /// Cache Country Percentages
        /// </summary>
        public void CacheCountryPercentages()
        {
            var data = new StatsCountryPercentages().CallObjects <CountryPercentage>();
            var blob = new JsonContainer();

            blob.Save("globalheatmap", data);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Cache Home Page Data
        /// </summary>
        public void CacheHomePageData()
        {
            var data = new HomePageData()
            {
                Share = new GoodsRecentItemShare().CallObject <HomePageShare>(),
            };

            var blob = new JsonContainer();

            blob.Save("landingpage", data);
        }
Exemplo n.º 3
0
        public void RoundTrip()
        {
            var data = new SearchLocationIp()
            {
                Location = Guid.NewGuid().ToString(),
            };

            var objId     = "a" + Guid.NewGuid().ToString();
            var container = new JsonContainer("jsontests");

            container.Create().Wait();

            container.Save(objId, data).Wait();

            var result = container.Get <SearchLocationIp>(objId);

            Assert.IsNotNull(result);
            Assert.AreEqual <string>(data.Location, result.Location);
        }
        public void SaveGet()
        {
            var random    = new Random();
            var container = new JsonContainer <Entity>(CloudStorageAccount.DevelopmentStorageAccount);

            container.EnsureExist();
            var entity = new Entity()
            {
                PartitionKey = Guid.NewGuid().ToBase64(),
                RowKey       = Guid.NewGuid().ToAscii85(),
                ToTest       = random.Next()
            };
            var id = Guid.NewGuid().ToString();

            container.Save(id, entity);

            var returned = container.Get(id);

            Assert.IsNotNull(returned);
            Assert.AreEqual <string>(entity.PartitionKey, returned.PartitionKey);
            Assert.AreEqual <string>(entity.RowKey, returned.RowKey);
            Assert.AreEqual <int>(entity.ToTest, returned.ToTest);
        }
Exemplo n.º 5
0
        public void SaveNullObj()
        {
            var container = new JsonContainer <Entity>(CloudStorageAccount.DevelopmentStorageAccount);

            container.Save(StringHelper.ValidString(), null);
        }
Exemplo n.º 6
0
        public void SaveInvalidId()
        {
            var container = new JsonContainer <Entity>(CloudStorageAccount.DevelopmentStorageAccount);

            container.Save(StringHelper.NullEmptyWhiteSpace(), new Entity());
        }