Beispiel #1
0
        public void TestInterface()
        {
            var test = new TargetClass {
                Id = 1, SubInterface = new InterfaceClass {
                    Id = 5, Value = 6
                }
            };

            _databaseInstance.SaveAsync(test).Wait();

            var actual = _databaseInstance.LoadAsync <TargetClass>(1).Result;

            Assert.AreEqual(test.Id, actual.Id, "Failed to load class with interface property: key mismatch.");
            Assert.IsNotNull(test.SubInterface, "Failed to load class with interface property: interface property is null.");
            Assert.AreEqual(test.SubInterface.Id, actual.SubInterface.Id, "Failed to load class with interface property: interface id mismatch.");
            Assert.AreEqual(test.SubInterface.Value, actual.SubInterface.Value, "Failed to load class with interface property: value mismatch.");
        }
        public void TestInterface()
        {
            var test = new TargetClass { Id = 1, SubInterface = new InterfaceClass { Id = 5, Value = 6 }};

            _databaseInstance.SaveAsync( test ).Wait();

            var actual = _databaseInstance.LoadAsync<TargetClass>( 1 ).Result;
            
            Assert.AreEqual(test.Id, actual.Id, "Failed to load class with interface property: key mismatch.");
            Assert.IsNotNull(test.SubInterface, "Failed to load class with interface property: interface property is null.");
            Assert.AreEqual(test.SubInterface.Id, actual.SubInterface.Id, "Failed to load class with interface property: interface id mismatch.");
            Assert.AreEqual(test.SubInterface.Value, actual.SubInterface.Value, "Failed to load class with interface property: value mismatch.");            
        }