Esempio n. 1
0
        public void can_copy_null_nullable_long_to_default()
        {
            var input = new SingleProp <long?> {
                Value = (long?)null
            };
            var output = input.Copy <SingleProp <long?>, SingleProp <long> >();

            Assert.AreEqual(0, output.Value);
        }
Esempio n. 2
0
        public void can_copy_null_nullable_int_to_long()
        {
            var input = new SingleProp <int?> {
                Value = (int?)null
            };
            var output = input.Copy <SingleProp <int?>, SingleProp <long> >();

            Assert.AreEqual(0, output.Value);
        }
Esempio n. 3
0
        public void can_copy_nullable_int_to_int()
        {
            var input = new SingleProp <int?> {
                Value = 1
            };
            var output = input.Copy <SingleProp <int?>, SingleProp <int> >();

            Assert.AreEqual(1, output.Value);
        }
Esempio n. 4
0
        public void can_copy_nullable_long_to_long()
        {
            var input = new SingleProp <long?> {
                Value = 1
            };
            var output = input.Copy <SingleProp <long?>, SingleProp <long> >();

            Assert.AreEqual(input.Value.Value, output.Value);
        }
Esempio n. 5
0
        public void can_copy_nullable_long_to_nullable_enum()
        {
            var input = new SingleProp <long?> {
                Value = 1
            };
            SingleProp <TestEnum?> output = input.Copy <SingleProp <long?>, SingleProp <TestEnum?> >();

            Assert.AreEqual((TestEnum)input.Value, output.Value);
        }
Esempio n. 6
0
        public void can_copy_null_value_nullable_enum_to_nullable_int_as_null()
        {
            var input = new SingleProp <TestEnum?> {
                Value = null
            };
            var output = input.Copy <SingleProp <TestEnum?>, SingleProp <int?> >();

            Assert.AreEqual(null, output.Value);
        }
Esempio n. 7
0
        public void can_copy_nullable_enum_to_nullable_int()
        {
            var input = new SingleProp <TestEnum?> {
                Value = TestEnum.Something
            };
            var output = input.Copy <SingleProp <TestEnum?>, SingleProp <int?> >();

            Assert.AreEqual(1, output.Value);
        }
Esempio n. 8
0
        public void can_copy_enum_to_another_enum()
        {
            var input = new SingleProp <TestEnum> {
                Value = TestEnum.Something
            };
            var output = input.Copy <SingleProp <TestEnum>, SingleProp <TestEnum2> >();

            Assert.AreEqual((int)input.Value, (int)output.Value);
        }
Esempio n. 9
0
        public void can_copy_long_to_enum()
        {
            var input = new SingleProp <long> {
                Value = 1
            };
            var output = input.Copy <SingleProp <long>, SingleProp <TestEnum> >();

            Assert.AreEqual((TestEnum)input.Value, output.Value);
        }
Esempio n. 10
0
        public void can_copy_enum_to_long()
        {
            var input = new SingleProp <TestEnum> {
                Value = TestEnum.Something
            };
            var output = input.Copy <SingleProp <TestEnum>, SingleProp <long> >();

            Assert.AreEqual((long)input.Value, output.Value);
        }
Esempio n. 11
0
        public void can_copy_class_to_struct()
        {
            var input = new SingleProp <int> {
                Value = 1
            };
            var output = input.Copy <SingleProp <int>, SinglePropStruct <int> >();

            Assert.AreEqual(input.Value, output.Value);
        }
Esempio n. 12
0
        public void can_copy_name_without_id_to_name_ending_in_id_enum()
        {
            var input = new SingleProp <TestEnum> {
                Value = TestEnum.Something
            };
            var output = input.Copy <SingleProp <TestEnum>, SingleId <int> >();

            Assert.AreEqual(1, output.ValueId);
        }
Esempio n. 13
0
        public void can_clone_decimal_property()
        {
            var input = new SingleProp <decimal> {
                Value = 1.1m
            };
            var copy = input.Copy();

            Assert.AreNotSame(input, copy);
            Assert.AreEqual(input.Value, copy.Value);
        }
Esempio n. 14
0
        public void can_clone_array_property()
        {
            var input = new SingleProp <decimal[]> {
                Value = new [] { 1m, 2m }
            };
            var copy = input.Copy();

            Assert.AreNotSame(input, copy);
            Assert.AreSame(input.Value, copy.Value);
        }
Esempio n. 15
0
        public void can_clone_bool_property()
        {
            var input = new SingleProp <bool> {
                Value = true
            };
            var copy = input.Copy();

            Assert.AreNotSame(input, copy);
            Assert.AreEqual(input.Value, copy.Value);
        }
Esempio n. 16
0
        public void can_clone_float_property()
        {
            var input = new SingleProp <float> {
                Value = 1.1f
            };
            var copy = input.Copy();

            Assert.AreNotSame(input, copy);
            Assert.AreEqual(input.Value, copy.Value);
        }
Esempio n. 17
0
        public void can_clone_datetime_property()
        {
            var input = new SingleProp <DateTime> {
                Value = DateTime.Now
            };
            var copy = input.Copy();

            Assert.AreNotSame(input, copy);
            Assert.AreEqual(input.Value, copy.Value);
        }
Esempio n. 18
0
        public void can_clone_string_property()
        {
            var input = new SingleProp <string> {
                Value = "hello"
            };
            var copy = input.Copy();

            Assert.AreNotSame(input, copy);
            Assert.AreSame(input.Value, copy.Value);
        }
Esempio n. 19
0
        public void can_clone_list_property()
        {
            var input = new SingleProp <List <string> > {
                Value = new List <string> {
                    "one", "two"
                }
            };
            var copy = input.Copy();

            Assert.AreNotSame(input, copy);
            Assert.AreSame(input.Value, copy.Value);
        }