Exemplo n.º 1
0
        public void DefaultKeyExample()
        {
            const int id = 6133;
            const string value = "norfen pls";

            var db = new SimpleDataStore("keyExamples");
            var input = new KeyExampleClass {Id = id, Value = value};
            db.Save(input);

            var result = db.Get<KeyExampleClass>(id);
            Assert.Equal(result.Value, value);
        }
Exemplo n.º 2
0
        public void OverrideKeyExample()
        {
            const int id = 164;
            const int registrationNumber = 171339811;
            const string value = "acualy is beef";

            var db = new SimpleDataStore("keyExamples");
            db.Configure<KeyExampleClass>("keyExample1", "RegistrationNumber");

            var input = new KeyExampleClass {Id = id, RegistrationNumber = registrationNumber, Value = value};
            db.Save(input);

            var result = db.Get<KeyExampleClass>(id);
            Assert.Null(result);

            result = db.Get<KeyExampleClass>(registrationNumber);
            Assert.Equal(result.Value, value);
        }