public void FormatDateForEnglishServerWithFrenchLocalCulture() { IVssLocale locale = new VssLocale(FrCulture()); locale.ServerCulture = "en-US"; Assert.AreEqual("added", locale.AddedKeyword); Assert.AreEqual("22/02/2002;12:00", locale.FormatCommandDate(new DateTime(2002, 2, 22, 12, 0, 0))); }
public void SetUp() { CreateProcessExecutorMock(DEFAULT_SS_EXE_PATH); mockRegistry = new DynamicMock(typeof(IRegistry)); mockProcessExecutor.Strict = true; mockRegistry.SetupResult("GetExpectedLocalMachineSubKeyValue", DEFAULT_SS_EXE_PATH, typeof(string), typeof(string)); VssLocale locale = new VssLocale(CultureInfo.InvariantCulture); historyParser = new VssHistoryParser(locale); vss = new Vss(locale, historyParser, (ProcessExecutor) mockProcessExecutor.MockInstance, (IRegistry) mockRegistry.MockInstance); vss.Project = "$/fooProject"; vss.Culture = string.Empty; // invariant culture vss.Username = "******"; vss.Password = "******"; vss.WorkingDirectory = DefaultWorkingDirectory; today = DateTime.Now; yesterday = today.AddDays(-1); }
public void ShouldBeAbleToCreateAllLocales() { // Extend this list when new translations are added. Each entry is // "ll" or "ll-CC" where "ll" is the two-character langage code (e.g., // "en" for English) and "CC" is the two-character country code (e.g., // "US" for the United States). There must be a "VssLocale.ll.resx" file // or a "VssLocal.ll-CC.resx" file. Also include "en" for the default // English locale and "" for the invariate locale. string[] localeNames = {"", "de", "en", "es", "fr", "ja"}; foreach (string localeName in localeNames) { CultureInfo culture = new CultureInfo(localeName); VssLocale locale = new VssLocale(culture); Assert.IsNotNull(locale, "Locale for \"{0}\"", localeName); } }
public void ParseDateAndTime() { IVssLocale vssLocale = new VssLocale(CultureInfo.InvariantCulture); Assert.AreEqual(new DateTime(2002, 2, 22, 12, 0, 0), vssLocale.ParseDateTime("02/22/2002", "12:00")); }
public void FormatDateInUKFormatWithAMPMIndicator() { IVssLocale vssLocale = new VssLocale(UkCultureWithAmPmTimeFormat()); Assert.AreEqual("22/02/2002;8:00p", vssLocale.FormatCommandDate(new DateTime(2002, 2, 22, 20, 0, 0, 34))); Assert.AreEqual("22/02/2002;12:00p", vssLocale.FormatCommandDate(new DateTime(2002, 2, 22, 12, 0, 0))); }
public void FormatDateInUKFormat() { IVssLocale vssLocale = new VssLocale(UkCulture()); Assert.AreEqual("22/02/2002;20:00", vssLocale.FormatCommandDate(new DateTime(2002, 2, 22, 20, 0, 0, 34))); Assert.AreEqual("22/02/2002;12:00", vssLocale.FormatCommandDate(new DateTime(2002, 2, 22, 12, 0, 0))); }
public void FormatDateInUSFormat() { IVssLocale vssLocale = new VssLocale(UsCuture()); Assert.AreEqual("2/22/2002;8:00p", vssLocale.FormatCommandDate(new DateTime(2002, 2, 22, 20, 0, 0))); Assert.AreEqual("2/22/2002;12:00p", vssLocale.FormatCommandDate(new DateTime(2002, 2, 22, 12, 0, 0))); }
public void FormatDateInCultureInvariantFormat() { IVssLocale vssLocale = new VssLocale(CultureInfo.InvariantCulture); Assert.AreEqual("02/22/2002;20:00", vssLocale.FormatCommandDate(new DateTime(2002, 2, 22, 20, 0, 0))); Assert.AreEqual("02/22/2002;12:00", vssLocale.FormatCommandDate(new DateTime(2002, 2, 22, 12, 0, 0))); }