예제 #1
0
        public void Caster_input_string20_output_int20()
        {
            //arrange
            string a        = "20";
            int    expected = 20;

            //act
            var actual = TypesConversion.ConvertValue <int>(a);

            //assert
            Assert.AreEqual(actual, expected);
        }
예제 #2
0
        public void Caster_input_stringTrue_output_bool_true()
        {
            //arrange
            string a        = "true";
            bool   expected = true;

            //act
            var actual = TypesConversion.ConvertValue <bool>(a);

            //assert
            Assert.AreEqual(actual, expected);
        }
예제 #3
0
        public void Caster_input_stringOlolo_output_null()
        {
            //arrange
            string a        = "ololo";
            int    expected = 0;

            //act
            var actual = TypesConversion.ConvertValue <int>(a);

            //assert
            Assert.AreEqual(actual, expected);
        }
예제 #4
0
        public void Caster_input_string20_2_output_double20_2()
        {
            //arrange
            string a        = "20,2";
            double expected = 20.2;

            //act
            var actual = TypesConversion.ConvertValue <double>(a);

            //assert
            Assert.AreEqual(actual, expected);
        }