Beispiel #1
0
        public UnitManager1 SetValue(object value, params object[] contextParams)
        {
            var context = Join(m_dataKind, contextParams);

            storage.AddValue(value, m_typeName, m_propertyName, context.ToArray());

            return(this);
        }
        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);
        }
        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);
        }