コード例 #1
0
        public void ResourceManagerHelpersTests_ValidateCulture_SendAvailableCulturesListNullArgument_ExpectException()
        {
            //arrange
            string culture = "ua";
            var resHelpers = new ResourceManagerHelpers();

            //act
            var isValid = resHelpers.ValidateCulture(culture, null);
        }
コード例 #2
0
        public void ResourceManagerHelpersTests_ValidateCulture_SendInvalidCultureAndListOfAvailableCulture_GetFalseValidation(string culture)
        {
            //arrange
            var resHelpers = new ResourceManagerHelpers();

            //act
            var isValid = resHelpers.ValidateCulture(culture, _availableCultures);

            //assert
            Assert.IsFalse(isValid);
        }
コード例 #3
0
        public void ResourceManagerHelpersTests_ValidateCulture_SendCultureNullArgument_GetFalse()
        {
            //arrange
            string culture = null;
            var resHelpers = new ResourceManagerHelpers();

            //act
            var isValid = resHelpers.ValidateCulture(culture, _availableCultures);

            //assert
            Assert.IsFalse(isValid);
        }
コード例 #4
0
        public void ResourceManagerHelpers_NormalizeCultureParameter_SendDistortedLetters_NormalValue_GetTrue(
            string value)
        {
            //arrange
            const int expectedLength = 2;
            var resHelpers = new ResourceManagerHelpers();

            //act
            resHelpers.NormalizeCultureParameter(ref value);

            //assert
            Assert.IsTrue(value.Length == expectedLength);
            Assert.IsTrue(value.All(char.IsLower));
        }
コード例 #5
0
        public void ResourceManagerHelpers_NormalizeCultureParameter_SendTooShortOrEmptyString_EmptyString_AreEqualWithExpectedValue(string value)
        {
            //arrange
            var resHelpers = new ResourceManagerHelpers();
            string expectedValue = String.Empty;

            //act
            resHelpers.NormalizeCultureParameter(ref value);

            //assert
            Assert.AreEqual(expectedValue, value);
        }
コード例 #6
0
        public void ResourceManagerHelpers_NormalizeCultureParameter_SendSymbols_GetFirstTwoSymbols_()
        {
            //arrange
            var resHelpers = new ResourceManagerHelpers();
            string value = "&$&#$@";
            string expectedValue = "&$";

            //act
            resHelpers.NormalizeCultureParameter(ref value);

            //assert
            Assert.AreEqual(expectedValue, value);
        }
コード例 #7
0
        public void ResourceManagerHelpers_NormalizeCultureParameter_SendNullArgument_GetException()
        {
            //arrange
            var resHelpers = new ResourceManagerHelpers();
            string value = null;

            //act
            resHelpers.NormalizeCultureParameter(ref value);
        }