Exemple #1
0
        public void LanguageDefaultsToUserLanguage(string culture, string language)
        {
            CultureInfo.CurrentUICulture = new CultureInfo(culture);

            var sut = new ProductsControllerTestBuilder().WithProductLanguage(language).Build();

            Assert.Equal(language, sut.LanguageCode);
        }
Exemple #2
0
        public void NextLanguage_Succeeds_WithoutProduct()
        {
            var supportedLanguages = new List <string> {
                "en", "nl", "fr", "de"
            };
            var sut = new ProductsControllerTestBuilder()
                      .WithSupportedLanguages(supportedLanguages)
                      .WithoutProduct()
                      .Build();

            Assert.Equal("en", sut.LanguageCode);
            sut.NextLanguage();
            Assert.Equal("nl", sut.LanguageCode);
        }
Exemple #3
0
        public void NextLanguage_Succeeds(string current, string next)
        {
            var supportedLanguages = new List <string> {
                "en", "nl", "fr", "de"
            };
            var sut = new ProductsControllerTestBuilder()
                      .WithSupportedLanguages(supportedLanguages)
                      .WithProductLanguage(current)
                      .Build();

            Assert.Equal(current, sut.LanguageCode);
            sut.NextLanguage();
            Assert.Equal(next, sut.LanguageCode);
        }