Esempio n. 1
0
        public void Validate_SuccessfullyValidatesNonDefaultNames(string language)
        {
            SetUpFixtureForTesting(language);

            var validator = new DefaultNamesValidator();

            var result = validator.Validate("MyOwnName");

            Assert.True(result.IsValid);
            Assert.True(result.Errors.Count == 0);
        }
Esempio n. 2
0
        public void Validate_SuccessfullyIdentifiesDefaultNames(string language)
        {
            SetUpFixtureForTesting(language);

            var validator = new DefaultNamesValidator();

            var result = validator.Validate("LiveTile");

            Assert.False(result.IsValid);
            Assert.True(result.Errors.Count == 1);
            Assert.Equal(ValidationErrorType.ReservedName, result.Errors.FirstOrDefault()?.ErrorType);
            Assert.Equal(nameof(DefaultNamesValidator), result.Errors.FirstOrDefault()?.ValidatorName);
        }