Esempio n. 1
0
        private void TestEnumHashKeyObjects()
        {
            // Create and save item
            EnumProduct1 product1 = new EnumProduct1
            {
                Id   = Status.Upcoming,
                Name = "CloudSpotter"
            };

            Context.Save(product1);

            EnumProduct2 product2 = new EnumProduct2
            {
                Id   = Status.Removed,
                Name = "CloudSpotter"
            };

            Context.Save(product2);

            var rt1 = Context.Load(product1);

            Assert.AreEqual(product1.Id, rt1.Id);
            Assert.AreEqual(product1.IdAsInt, rt1.IdAsInt);

            var rt2 = Context.Load(product2);

            Assert.AreEqual(product2.Id, rt2.Id);

            Context.Delete(product1);
            Context.Delete(product2);
        }
Esempio n. 2
0
        private async Task TestEnumHashKeyObjects()
        {
            // Create and save item
            EnumProduct1 product1 = new EnumProduct1
            {
                Id   = Status.Upcoming,
                Name = "CloudSpotter"
            };
            await SharedTestFixture.Context.SaveAsync(product1);

            EnumProduct2 product2 = new EnumProduct2
            {
                Id   = Status.Removed,
                Name = "CloudSpotter"
            };
            await SharedTestFixture.Context.SaveAsync(product2);

            var rt1 = await SharedTestFixture.Context.LoadAsync(product1);

            Assert.Equal(product1.Id, rt1.Id);
            Assert.Equal(product1.IdAsInt, rt1.IdAsInt);

            var rt2 = await SharedTestFixture.Context.LoadAsync(product2);

            Assert.Equal(product2.Id, rt2.Id);

            await SharedTestFixture.Context.DeleteAsync(product1);

            await SharedTestFixture.Context.DeleteAsync(product2);
        }