ewilde / crane

Crane creates builds scripts so you don't have to
http://blog.cranebuild.com
Apache License 2.0
6 stars 2 forks source link

[build template] convention tests, add to unit test project #30

Open ewilde opened 9 years ago

ewilde commented 9 years ago

In keeping with being opinionated:

I think it's nice to have tests that make sure the structure of code is adhered to:

i.e. (but do this in xbehave)

 [Test]
        public void debug_configurations_should_have_debug_type_pdb_only()
        {
            Convention.Is(new ConfigurationHasSpecificValue(ConfigurationType.Debug, "DebugType", "full"), new ProjectPropertyGroups(typeof(DomainClass).Assembly, projectProvider, projectLocator));
        }

        [Test]
        public void debug_configurations_should_have_optimize_false()
        {
            Convention.Is(new ConfigurationHasSpecificValue(ConfigurationType.Debug, "Optimize", "false"), new ProjectPropertyGroups(typeof(DomainClass).Assembly, projectProvider, projectLocator));
        }

        [Test]
        public void release_configurations_should_have_debug_type_pdb_only()
        {
            Convention.Is(new ConfigurationHasSpecificValue(ConfigurationType.Release, "DebugType", "pdbonly"), new ProjectPropertyGroups(typeof(DomainClass).Assembly, projectProvider, projectLocator));
        }

        [Test]
        public void release_configurations_should_have_optimize_true()
        {
            Convention.Is(new ConfigurationHasSpecificValue(ConfigurationType.Release, "Optimize", "true"), new ProjectPropertyGroups(typeof(DomainClass).Assembly, projectProvider, projectLocator));
        }