Inheritance: System.Windows.DependencyObject, IValueConverter
        public void DateTimeToStringConverter_Convert_ValueNotDateTime_NoStringReturned()
        {
            //------------Setup for test--------------------------
            var dateTimeToStringConverter = new DateTimeToStringConverter();

            //------------Execute Test---------------------------
            var convertedValue = dateTimeToStringConverter.Convert("some data", null, null, null);
            //------------Assert Results-------------------------
            Assert.IsNotInstanceOfType(convertedValue, typeof(string));
        }
 public void DateTimeToStringConverter_Convert_HasDateTimeValue_StringWithSplitSeconds()
 {
     //------------Setup for test--------------------------
     var dateTimeToStringConverter = new DateTimeToStringConverter();
     var dateTimeToConvert = new DateTime(2014, 01, 02, 10, 15, 52, 52);
     //------------Execute Test---------------------------
     var convertedValue = dateTimeToStringConverter.Convert(dateTimeToConvert, null, null, null);
     //------------Assert Results-------------------------
     Assert.AreEqual("2014/01/02 10:15:52.0520 AM", convertedValue);
 }
 public void DateTimeToStringConverter_Convert_HasFormat_StringUsingProvidedFormat()
 {
     //------------Setup for test--------------------------
     var dateTimeToStringConverter = new DateTimeToStringConverter();
     dateTimeToStringConverter.Format = "dd/MMM/yyyy";
     var dateTimeToConvert = new DateTime(2014, 01, 02, 10, 15, 52, 52);
     //------------Execute Test---------------------------
     var convertedValue = dateTimeToStringConverter.Convert(dateTimeToConvert, null, null, null);
     //------------Assert Results-------------------------
     Assert.AreEqual("02/Jan/2014", convertedValue);
 }
        public DebugOutputFilterStrategy()
        {
            if(Application.Current != null)
            {
                _timeSpanToStringConverter = Application.Current.Resources["TimeSpanToStringConverter"] as TimeSpanToStringConverter;
                _dateTimeToStringConverter = Application.Current.Resources["DateTimeToStringConverter"] as DateTimeToStringConverter;
                _enumToStringConverter = Application.Current.Resources["EnumToStringConverter"] as EnumToStringConverter;
            }

            if(_timeSpanToStringConverter == null)
            {
                _timeSpanToStringConverter = new TimeSpanToStringConverter();
            }

            if(_dateTimeToStringConverter == null)
            {
                _dateTimeToStringConverter = new DateTimeToStringConverter();
            }

            if(_enumToStringConverter == null)
            {
                _enumToStringConverter = new EnumToStringConverter();
            }
        }