public void UiCulturesAndProductCulturesAndUiCultureAndProductCulture() { var thread = Thread.CurrentThread; thread.CurrentCulture = new CultureInfo("en-US"); sut = new SettingsViewModel(factories, learningCuAndFpu); Assert.AreEqual(sut.UiCultures.Count, sut.UiCultures.Distinct().Count()); Assert.AreEqual(sut.ProductCultures.Count, sut.ProductCultures.Distinct().Count()); Assert.IsTrue(sut.UiCultures .Count(item => item.ToLower().StartsWith("english")) == 1); Assert.IsTrue(sut.ProductCultures .Count(item => item.ToLower().StartsWith("english")) > 1); foreach (var culture in sut.UiCultures) { sut.UiCulture = culture; Assert.AreEqual(culture, sut.UiCulture); } foreach (var culture in sut.ProductCultures) { sut.ProductCulture = culture; Assert.AreEqual(culture, sut.ProductCulture); } }
public void TestInitialize() { factories = Substitute.For<Factories>(); settings = new Settings(); factories.Settings.Returns(settings); learningCuAndFpu = Substitute.For<LearningCuAndFpu>(); sut = new SettingsViewModel(factories, learningCuAndFpu); }