Beispiel #1
0
        public void GetInsertAndGet()
        {
            var store = new AzureBigTableStore<HasIdentityAndRange>(connectionString:ConnectionString);
            var item = new HasIdentityAndRange()
            {
                Id = Guid.NewGuid().ToString(),
                RangeKey = "1"
            };
            store.InsertAsync(item).Wait();

            Assert.True(store.ExistsAsync(item.Id,item.RangeKey).Result);
        }
Beispiel #2
0
        public void GetInsertAndGet()
        {
            var store = new AzureBigTableStore <HasIdentityAndRange>(connectionString: ConnectionString);
            var item  = new HasIdentityAndRange()
            {
                Id       = Guid.NewGuid().ToString(),
                RangeKey = "1"
            };

            store.InsertAsync(item).Wait();

            Assert.True(store.ExistsAsync(item.Id, item.RangeKey).Result);
        }
Beispiel #3
0
        public void CanInsertAndDelete()
        {
            var store = new AzureBigTableStore<HasIdentityAndRange>(connectionString: ConnectionString);
            var item = new HasIdentityAndRange()
            {
                Id = Guid.NewGuid().ToString(),
                RangeKey = "1",
                LastModified = DateTimeOffset.Now
            };
            store.InsertAsync(item).Wait();
            store.DeleteAsync(item).Wait();

            Assert.False(store.ExistsAsync(item.Id, item.RangeKey).Result);
        }
Beispiel #4
0
        public void CanInsertAndDelete()
        {
            var store = new AzureBigTableStore <HasIdentityAndRange>(connectionString: ConnectionString);
            var item  = new HasIdentityAndRange()
            {
                Id           = Guid.NewGuid().ToString(),
                RangeKey     = "1",
                LastModified = DateTimeOffset.Now
            };

            store.InsertAsync(item).Wait();
            store.DeleteAsync(item).Wait();

            Assert.False(store.ExistsAsync(item.Id, item.RangeKey).Result);
        }
Beispiel #5
0
        public void CanGetRange()
        {
            var store = new AzureBigTableStore<HasIdentityAndRange>(connectionString: ConnectionString);
            var item = new HasIdentityAndRange()
            {
                Id = Guid.NewGuid().ToString(),
                RangeKey = "1"
            }; 
            var item2 = new HasIdentityAndRange()
            {
                Id = item.Id,
                RangeKey = "2"
            };
            store.InsertAsync(item).Wait();
            store.InsertAsync(item2).Wait();

            Assert.Equal(2, store.GetRangeAsync(item.Id, "1", "2").Result.Count());
        }
Beispiel #6
0
        public void CanGetRange()
        {
            var store = new AzureBigTableStore <HasIdentityAndRange>(connectionString: ConnectionString);
            var item  = new HasIdentityAndRange()
            {
                Id       = Guid.NewGuid().ToString(),
                RangeKey = "1"
            };
            var item2 = new HasIdentityAndRange()
            {
                Id       = item.Id,
                RangeKey = "2"
            };

            store.InsertAsync(item).Wait();
            store.InsertAsync(item2).Wait();

            Assert.Equal(2, store.GetRangeAsync(item.Id, "1", "2").Result.Count());
        }
Beispiel #7
0
        public void CanInsertAndGet()
        {
            var store = new AzureBigTableStore <HasIdentityAndRange>(connectionString: ConnectionString);
            var item  = new HasIdentityAndRange()
            {
                Id           = Guid.NewGuid().ToString(),
                RangeKey     = "1",
                ETag         = "\"" + Guid.NewGuid().ToString() + "\"",
                LastModified = DateTimeOffset.Now,
                When         = DateTimeOffset.Now,
                When2        = DateTime.Now,
                When4        = DateTimeOffset.Now,
                HowMany      = 1,
                HowMany2     = 83248926438962,
                HowMuch      = 32423.45243,
                Secret       = Guid.NewGuid(),
                What         = "chapooli",
                Really       = true,
                Booboo       = new byte[100]
            };

            store.InsertAsync(item).Wait();

            var storedItem = store.GetAsync(item.Id, item.RangeKey).Result;

            Assert.Equal(item.Id, storedItem.Id);
            Assert.Equal(item.RangeKey, storedItem.RangeKey);
            Assert.Equal(item.HowMany, storedItem.HowMany);
            Assert.Equal(item.HowMany2, storedItem.HowMany2);
            Assert.Equal(item.HowMany3, storedItem.HowMany3);
            Assert.Equal(item.HowMuch, storedItem.HowMuch);
            Assert.Equal(item.What, storedItem.What);
            Assert.Equal(item.Really, storedItem.Really);
            Assert.Equal(item.Really2, storedItem.Really2);
            Assert.Equal(item.Secret, storedItem.Secret);
            Assert.Equal(item.Secret2, storedItem.Secret2);
            Assert.Equal(item.Booboo, storedItem.Booboo);
            Assert.Equal(item.When, storedItem.When);
            Assert.Equal(item.When2.Value.ToUniversalTime(), storedItem.When2);
            Assert.Equal(item.When4, storedItem.When4);
            Assert.Equal(item.When3, storedItem.When3);
        }
Beispiel #8
0
        public void CanInsertAndGet()
        {
            var store = new AzureBigTableStore<HasIdentityAndRange>(connectionString:ConnectionString);
            var item = new HasIdentityAndRange()
            {
                Id = Guid.NewGuid().ToString(),
                RangeKey = "1",
                ETag = "\"" + Guid.NewGuid().ToString() + "\"",
                LastModified = DateTimeOffset.Now,
                When = DateTimeOffset.Now,
                When2 = DateTime.Now,
                When4 = DateTimeOffset.Now,
                HowMany = 1,
                HowMany2 = 83248926438962,
                HowMuch = 32423.45243,
                Secret = Guid.NewGuid(),
                What = "chapooli",
                Really = true,
                Booboo = new byte[100]
            };
            store.InsertAsync(item).Wait();

            var storedItem = store.GetAsync(item.Id, item.RangeKey).Result;
            Assert.Equal(item.Id, storedItem.Id);
            Assert.Equal(item.RangeKey, storedItem.RangeKey);
            Assert.Equal(item.HowMany, storedItem.HowMany);
            Assert.Equal(item.HowMany2, storedItem.HowMany2);
            Assert.Equal(item.HowMany3, storedItem.HowMany3);
            Assert.Equal(item.HowMuch, storedItem.HowMuch);
            Assert.Equal(item.What, storedItem.What);
            Assert.Equal(item.Really, storedItem.Really);
            Assert.Equal(item.Really2, storedItem.Really2);
            Assert.Equal(item.Secret, storedItem.Secret);
            Assert.Equal(item.Secret2, storedItem.Secret2);
            Assert.Equal(item.Booboo, storedItem.Booboo);
            Assert.Equal(item.When, storedItem.When);
            Assert.Equal(item.When2.Value.ToUniversalTime(), storedItem.When2);
            Assert.Equal(item.When4, storedItem.When4);
            Assert.Equal(item.When3, storedItem.When3);
        }
Beispiel #9
0
        public async Task CanGetRange()
        {
            var store = new AzureBigTableStore <HasIdentityAndRange>(connectionString: ConnectionString);
            var item  = new HasIdentityAndRange()
            {
                Id           = Guid.NewGuid().ToString(),
                RangeKey     = "1",
                ETag         = "\"" + Guid.NewGuid().ToString() + "\"",
                LastModified = DateTimeOffset.Now
            };
            var item2 = new HasIdentityAndRange()
            {
                Id           = item.Id,
                RangeKey     = "2",
                ETag         = "\"" + Guid.NewGuid().ToString() + "\"",
                LastModified = DateTimeOffset.Now
            };
            await store.InsertAsync(item);

            await store.InsertAsync(item2);

            Assert.Equal(2, store.GetRangeAsync(item.Id, "1", "2").Result.Count());
        }