Ejemplo n.º 1
0
        public async Task ChangeCurrentCulture_SameCultureThanSelected_DoNothing()
        {
            // Arrange
            var currentCulture = new CultureInfo("en");
            var otherCulture   = new CultureInfo("es");

            _settingProvider.GetAvailableCultures().Returns(new List <CultureInfo> {
                currentCulture, otherCulture
            });
            _settingProvider.GetCurrentCulture().Returns(currentCulture);
            await sut.Load();

            var selectedLanguage = sut.AvailableLanguages.FirstOrDefault(x => x.Culture == currentCulture);

            // Act
            sut.ChangeCurrentCulture(selectedLanguage);

            // Assert
            _settingProvider.DidNotReceiveWithAnyArgs().SetCurrentCulture(null);
            _messageDialog.DidNotReceiveWithAnyArgs().Show(default(string), default(string));
        }