Exemplo n.º 1
0
        public void Test_object()
        {
            var storage = new PropertyDataStorage();
            var val     = new object();

            storage.AddValue(val, "MyType1", "MyProperty", 8, Context1.C, true, Context2.B);

            Assert.IsFalse(storage.TryGetValue(out var result, "MyType1", "MyProperty", 8, Context1.C, true, Context2.A));
            Assert.IsTrue(storage.TryGetValue(out result, "MyType1", "MyProperty", 8, Context1.C, true, Context2.B));
            Assert.AreEqual(val, result);
        }
Exemplo n.º 2
0
        public void Test_int()
        {
            var       storage = new PropertyDataStorage();
            const int val     = 5;

            storage.AddValue(val, "MyType", "MyProperty", 8, Context1.C, true, Context2.B);

            Assert.IsFalse(storage.TryGetValue(out var result, "MyType", "MyProperty", 8, Context1.A, true, Context2.B));
            Assert.IsTrue(storage.TryGetValue(out result, "MyType", "MyProperty", 8, Context1.C, true, Context2.B));
            Assert.AreEqual(val, result);
        }
Exemplo n.º 3
0
        public bool TryGetValue(out object value, string typeName, string propertyName, params object[] contextParams)
        {
            var result = storage.TryGetValue(out value, typeName, propertyName, contextParams);

            return(result);
        }