Beispiel #1
0
        public void FieldNamingWatcherLowerCaseCheck_providedClassWithUpperCasePropertiesToBeSkipped_ShouldPass()
        {
            sut.Configure(Naming.LowerCase);
            sut.SkipType(typeof(FieldNamingPublicUppercase));

            sut.Execute();

            Assert.That(sut.Issues.Count, Is.EqualTo(0));
        }
        public void FieldNamingWatcherUpperCaseCheck_providedClassShouldPassWithAllUppercaseFields(Type type)
        {
            sut.Configure(Naming.UpperCase);
            sut.WatchType(type);

            sut.Execute();

            Assert.That(sut.Issues.Count, Is.EqualTo(0));
        }
Beispiel #3
0
        public void AllPropertiesInAssemblyMustStartWithUppercaseWillFail()
        {
            FieldNamingFirstLetterWatcher fieldNamingWatcher = new FieldNamingFirstLetterWatcher();

            fieldNamingWatcher.Configure(Naming.UpperCase);
            fieldNamingWatcher.WatchAssembly(typeof(DomainModel).Assembly);

            fieldNamingWatcher.Execute();

            //ruleViolations contain all fields that are not uppercase
            var ruleViolations = fieldNamingWatcher.Issues;

            //Failure!
            Assert.That(ruleViolations.Count, Is.GreaterThan(0));
        }