Exemplo n.º 1
0
		/// <summary>
		/// Converts argument to specified type.
		/// Supported types similar to StringConverter.
		/// </summary>
		/// <typeparam name="T"></typeparam>
		/// <param name="index"></param>
		/// <returns></returns>
		public T As<T>( int index ) 
		{
			return (T)StringConverter.ConvertFromString( typeof(T), args[index] );
		}
Exemplo n.º 2
0
        public void should_not_change_other_text_than_none_literal()
        {
            var converter = new StringConverter();

            converter.ConvertFromString("text_other_than_none", Mock.Of <IReaderRow>(), null).Should().Be("text other than none");
        }
Exemplo n.º 3
0
 /// <summary>
 /// Sets config variable from text value.
 /// </summary>
 /// <param name="value"></param>
 public void Set(string value)
 {
     TargetProperty.SetValue(TargetObject, StringConverter.ConvertFromString(TargetProperty.PropertyType, value));
 }
Exemplo n.º 4
0
        public void should_convert_none_literal_to_null()
        {
            var converter = new StringConverter();

            converter.ConvertFromString(TimetableLiterals.None, Mock.Of <IReaderRow>(), null).Should().BeNull();
        }