public void SeparatorsTest()
{
DateTimeFormatInfo dtfi = (DateTimeFormatInfo) CultureInfo.InvariantCulture.DateTimeFormat.Clone();
Assert.False(dtfi.IsReadOnly, "IsReadOnly expected to be false");
string dateSep = dtfi.DateSeparator;
string timeSep = dtfi.TimeSeparator;
Assert.True(dtfi.ShortDatePattern.IndexOf(dateSep) > 0, "dtfi.ShortDatePattern should be greater than 0");
Assert.True(dtfi.ShortTimePattern.IndexOf(timeSep) > 0, "dtfi.ShortTimePattern should be greater than 0");
DateTime d = DateTime.Now;
string formattedDate = d.ToString("MM/dd/yyyy", dtfi);
Assert.True(formattedDate.IndexOf(dateSep) > 0, "Expected to find date separator in the formatted string");
dtfi.DateSeparator = "-";
string expectedFormattedString = formattedDate.Replace(dateSep, dtfi.DateSeparator);
Assert.Equal(expectedFormattedString, d.ToString("MM/dd/yyyy", dtfi));
string formattedTime = d.ToString("HH:mm:ss", dtfi);
Assert.True(formattedTime.IndexOf(timeSep) > 0, "Expected to find time separator in the formatted string");
dtfi.TimeSeparator = ".";
expectedFormattedString = formattedTime.Replace(timeSep, dtfi.TimeSeparator);
Assert.Equal(expectedFormattedString, d.ToString("HH:mm:ss", dtfi));
}