예제 #1
0
        public void should_get_nullable_value()
        {
            var arguments = new List <string> {
                "102", "some string", "07-02-2010", "today"
            };
            var result = converter.Convert(arguments, new List <Type> {
                typeof(TestArgs)
            }) as TestArgs;
            var testArgs = new TestArgs
            {
                IntValue       = 102,
                StringValue    = "some string",
                DateTimeValue1 = DateTime.Parse("07-02-2010"),
                DateTimeValue2 = DateTime.Today
            };

            result.ShouldBeEquivalentTo(testArgs);
        }
예제 #2
0
        public void sould_get_all_arguments_without_nullable()
        {
            var arguments = new List <string> {
                "11", "lhkjh", "10-10-2012", ""
            };
            var result = converter.Convert(arguments, new List <Type> {
                typeof(TestArgs)
            }) as TestArgs;
            var testArgs = new TestArgs
            {
                IntValue       = 11,
                StringValue    = "lhkjh",
                DateTimeValue1 = DateTime.Parse("10-10-2012"),
                DateTimeValue2 = null
            };

            result.ShouldBeEquivalentTo(testArgs);
        }
예제 #3
0
 public void sould_get_all_arguments_without_nullable()
 {
     var arguments = new List<string> {"11", "lhkjh", "10-10-2012", ""};
     var result = converter.Convert(arguments, new List<Type> {typeof (TestArgs)}) as TestArgs;
     var testArgs = new TestArgs
                        {
                            IntValue = 11,
                            StringValue = "lhkjh",
                            DateTimeValue1 = DateTime.Parse("10-10-2012"),
                            DateTimeValue2 = null
                        };
     result.ShouldBeEquivalentTo(testArgs);
 }
예제 #4
0
 public void should_get_nullable_value()
 {
     var arguments = new List<string> {"102", "some string", "07-02-2010", "today"};
     var result = converter.Convert(arguments, new List<Type> {typeof (TestArgs)}) as TestArgs;
     var testArgs = new TestArgs
                        {
                            IntValue = 102,
                            StringValue = "some string",
                            DateTimeValue1 = DateTime.Parse("07-02-2010"),
                            DateTimeValue2 = DateTime.Today
                        };
     result.ShouldBeEquivalentTo(testArgs);
 }