public void ConvertBack(object input, Type targetType, object?parameter, string cultureString, object expectedOutput)
        {
            var converter = new DateTimeToStringConverter();
            var culture   = new CultureInfo(cultureString);
            var output    = converter.ConvertBack(input, targetType, parameter, culture);

            Assert.Equal(expectedOutput, output);
        }
        public void ConvertBack_Null_NotNullable()
        {
            // Arrange
            var converter = new DateTimeToStringConverter();

            // Act
            var result = (DateTime)converter.ConvertBack(null, null, null, null);

            // Assert
            Assert.AreEqual(new DateTime(), result);
        }
        public void ConvertBack_Null_Nullable()
        {
            // Arrange
            var converter = new DateTimeToStringConverter();

            converter.IsDateTimeNullable = true;

            // Act
            var result = converter.ConvertBack(null, null, null, null);

            // Assert
            Assert.IsNull(result);
        }
        public void ConvertBack()
        {
            // Arrange
            var converter = new DateTimeToStringConverter();

            var date = DateTime.Today;

            // Act
            var result = (DateTime)converter.ConvertBack(date.ToString("d"), null, null, null);

            // Assert
            Assert.AreEqual(date, result);
        }
        public void ConvertBack_NotParsable_Nullable()
        {
            // Arrange
            var converter = new DateTimeToStringConverter();

            converter.IsDateTimeNullable = true;

            // Act
            var result = converter.ConvertBack(Guid.NewGuid().ToString(), null, null, null);

            // Assert
            Assert.IsNull(result);
        }