Exemplo n.º 1
0
        public void MyClassCanBeCarrierObjectsForConnectorOfInterfaceType()
        {
            MyClass carrier            = new MyClass();
            var     propertyDefinition = new PropertyConnector <IMyInterface, int>();

            Assert.IsNotNull(propertyDefinition.TryGetProperty(carrier));
        }
Exemplo n.º 2
0
        public void MyStructCannotBeCarrierObjectsForConnectorOfInterfaceType()
        {
            MyStruct carrier            = new MyStruct();
            var      propertyDefinition = new PropertyConnector <IMyInterface, int>();

            Assert.IsNull(propertyDefinition.TryGetProperty(carrier));
        }
Exemplo n.º 3
0
        public void ObjectCanBeCarrierObjects_Try()
        {
            object carrier            = new object();
            var    propertyDefinition = new PropertyConnector <object, int>();

            Assert.IsNotNull(propertyDefinition.TryGetProperty(carrier));
        }
Exemplo n.º 4
0
        public void StringsCannotBeCarrierObjects_Try()
        {
            string carrier            = "Hi";
            var    propertyDefinition = new PropertyConnector <string, int>();

            Assert.IsNull(propertyDefinition.TryGetProperty(carrier));
        }
Exemplo n.º 5
0
        public void ValueTypesCannotBeCarrierObjects_Try()
        {
            int carrier            = 13;
            var propertyDefinition = new PropertyConnector <object, int>();

            Assert.IsNull(propertyDefinition.TryGetProperty(carrier));
        }
Exemplo n.º 6
0
        public void MyStructWithoutValidationCanBeCarrierObjectForConnectorOfInterfaceType()
        {
            // Please note: this is an extremely dangerous example! Do not use in real-world code!
            MyStruct carrier            = new MyStruct();
            var      propertyDefinition = new PropertyConnector <IMyInterface, int>();

            Assert.IsNotNull(propertyDefinition.TryGetProperty(carrier, true));
        }
Exemplo n.º 7
0
        public void StringsWithoutValidationCanBeCarrierObjects_Try()
        {
            // Please note: this is a highly dangerous example! Do not use in real-world code unless you know for-sure what you're doing!
            string carrier            = "Hi";
            var    propertyDefinition = new PropertyConnector <string, int>();

            Assert.IsNotNull(propertyDefinition.TryGetProperty(carrier, true));
        }
Exemplo n.º 8
0
        public void ValueTypesWithoutValidationCanBeCarrierObjects_Try()
        {
            // Please note: this is an extremely dangerous example! Do not use in real-world code!
            int carrier            = 13;
            var propertyDefinition = new PropertyConnector <object, int>();

            Assert.IsNotNull(propertyDefinition.TryGetProperty(carrier, true));
        }