Ejemplo n.º 1
0
        public void TestEnumSaveAndLoad()
        {
            var test = new EnumClass()
            {
                Id = 1, Value = TestEnums.Value2, ValueLong = TestEnumsLong.LongerValue
            };

            _databaseInstance.SaveAsync(test).Wait();
            var actual = _databaseInstance.LoadAsync <EnumClass>(1).Result;

            Assert.AreEqual(test.Id, actual.Id, "Failed to load enum: key mismatch.");
            Assert.AreEqual(test.Value, actual.Value, "Failed to load enum: value mismatch.");
            Assert.AreEqual(test.ValueLong, actual.ValueLong, "Failed to load enum: value mismatch.");
        }
Ejemplo n.º 2
0
        public void TestMultipleEnumSaveAndLoad()
        {
            var test1 = new EnumClass {
                Id = 1, Value = TestEnums.Value1, ValueLong = TestEnumsLong.LongValue
            };
            var test2 = new EnumClass {
                Id = 2, Value = TestEnums.Value2, ValueLong = TestEnumsLong.LongerValue
            };

            _databaseInstance.SaveAsync(test1).Wait();
            _databaseInstance.SaveAsync(test2).Wait();

            var actual1 = _databaseInstance.LoadAsync <EnumClass>(1).Result;
            var actual2 = _databaseInstance.LoadAsync <EnumClass>(2).Result;

            Assert.AreEqual(test1.Id, actual1.Id, "Failed to load enum: key 1 mismatch.");
            Assert.AreEqual(test1.Value, actual1.Value, "Failed to load enum: value 1 mismatch.");
            Assert.AreEqual(test1.ValueLong, actual1.ValueLong, "Failed to load enum: value 1 mismatch.");

            Assert.AreEqual(test2.Id, actual2.Id, "Failed to load enum: key 2 mismatch.");
            Assert.AreEqual(test2.Value, actual2.Value, "Failed to load enum: value 2 mismatch.");
            Assert.AreEqual(test2.ValueLong, actual2.ValueLong, "Failed to load enum: value 2 mismatch.");
        }
Ejemplo n.º 3
0
        public void TestMultipleEnumSaveAndLoad()
        {
            var test1 = new EnumClass { Id = 1, Value = TestEnums.Value1, ValueLong = TestEnumsLong.LongValue };
            var test2 = new EnumClass { Id = 2, Value = TestEnums.Value2, ValueLong = TestEnumsLong.LongerValue };

            _databaseInstance.SaveAsync( test1 ).Wait();
            _databaseInstance.SaveAsync( test2 ).Wait();

            var actual1 = _databaseInstance.LoadAsync<EnumClass>( 1 ).Result;
            var actual2 = _databaseInstance.LoadAsync<EnumClass>( 2 ).Result;

            Assert.AreEqual(test1.Id, actual1.Id, "Failed to load enum: key 1 mismatch.");
            Assert.AreEqual(test1.Value, actual1.Value, "Failed to load enum: value 1 mismatch.");
            Assert.AreEqual(test1.ValueLong, actual1.ValueLong, "Failed to load enum: value 1 mismatch.");

            Assert.AreEqual(test2.Id, actual2.Id, "Failed to load enum: key 2 mismatch.");
            Assert.AreEqual(test2.Value, actual2.Value, "Failed to load enum: value 2 mismatch.");
            Assert.AreEqual(test2.ValueLong, actual2.ValueLong, "Failed to load enum: value 2 mismatch.");
        }
Ejemplo n.º 4
0
 public void TestEnumSaveAndLoad()
 {
     var test = new EnumClass() { Id = 1, Value = TestEnums.Value2, ValueLong = TestEnumsLong.LongerValue };
     _databaseInstance.SaveAsync( test ).Wait();
     var actual = _databaseInstance.LoadAsync<EnumClass>( 1 ).Result;
     Assert.AreEqual(test.Id, actual.Id, "Failed to load enum: key mismatch.");
     Assert.AreEqual(test.Value, actual.Value, "Failed to load enum: value mismatch.");
     Assert.AreEqual(test.ValueLong, actual.ValueLong, "Failed to load enum: value mismatch.");
 }