22{
33 using System ;
44 using System . IO ;
5- using System . Xml . Linq ;
6- using NSubstitute ;
75 using NUnit . Framework ;
8- using SampleApp . Domain ;
9- using SampleApp . Dtos ;
106 using TestStack . ConventionTests ;
117 using TestStack . ConventionTests . ConventionData ;
128 using TestStack . ConventionTests . Conventions ;
13- using TestStack . ConventionTests . Internal ;
149
1510 [ TestFixture ]
1611 public class ProjectConfigurationTests
1712 {
18- IProjectLocator projectLocator ;
19- IProjectProvider projectProvider ;
13+ string projectLocation ;
2014
21- [ SetUp ]
22- public void Setup ( )
15+ public ProjectConfigurationTests ( )
2316 {
24- projectLocator = Substitute . For < IProjectLocator > ( ) ;
25- projectProvider = Substitute . For < IProjectProvider > ( ) ;
26- projectProvider
27- . LoadProjectDocument ( Arg . Any < string > ( ) )
28- . Returns ( XDocument . Parse ( File . ReadAllText ( Path . GetFullPath ( Path . Combine ( Environment . CurrentDirectory , @"..\..\..\SampleApp\SampleApp.csproj" ) ) ) ) ) ;
17+ projectLocation = Path . GetFullPath ( Path . Combine ( Environment . CurrentDirectory , @"..\..\..\SampleApp\SampleApp.csproj" ) ) ;
2918 }
3019
3120 [ Test ]
3221 public void debug_configurations_should_have_debug_type_pdb_only ( )
3322 {
34- Convention . Is ( new ConfigurationHasSpecificValue ( ConfigurationType . Debug , "DebugType" , "full" ) , new ProjectPropertyGroups ( typeof ( DomainClass ) . Assembly , projectProvider , projectLocator ) ) ;
23+ var configurationHasSpecificValue = new ConfigurationHasSpecificValue ( ConfigurationType . Debug , "DebugType" , "full" ) ;
24+ var projectPropertyGroups = new ProjectPropertyGroups ( projectLocation ) ;
25+ Convention . Is ( configurationHasSpecificValue , projectPropertyGroups ) ;
3526 }
3627
3728 [ Test ]
3829 public void debug_configurations_should_have_optimize_false ( )
3930 {
40- Convention . Is ( new ConfigurationHasSpecificValue ( ConfigurationType . Debug , "Optimize" , "false" ) , new ProjectPropertyGroups ( typeof ( DomainClass ) . Assembly , projectProvider , projectLocator ) ) ;
31+ var configurationHasSpecificValue = new ConfigurationHasSpecificValue ( ConfigurationType . Debug , "Optimize" , "false" ) ;
32+ var projectPropertyGroups = new ProjectPropertyGroups ( projectLocation ) ;
33+ Convention . Is ( configurationHasSpecificValue , projectPropertyGroups ) ;
4134 }
4235
4336 [ Test ]
4437 public void release_configurations_should_have_debug_type_pdb_only ( )
4538 {
46- Convention . Is ( new ConfigurationHasSpecificValue ( ConfigurationType . Release , "DebugType" , "pdbonly" ) , new ProjectPropertyGroups ( typeof ( DomainClass ) . Assembly , projectProvider , projectLocator ) ) ;
39+ var configurationHasSpecificValue = new ConfigurationHasSpecificValue ( ConfigurationType . Release , "DebugType" , "pdbonly" ) ;
40+ var projectPropertyGroups = new ProjectPropertyGroups ( projectLocation ) ;
41+ Convention . Is ( configurationHasSpecificValue , projectPropertyGroups ) ;
4742 }
4843
4944 [ Test ]
5045 public void release_configurations_should_have_optimize_true ( )
5146 {
52- Convention . Is ( new ConfigurationHasSpecificValue ( ConfigurationType . Release , "Optimize" , "true" ) , new ProjectPropertyGroups ( typeof ( DomainClass ) . Assembly , projectProvider , projectLocator ) ) ;
47+ var configurationHasSpecificValue = new ConfigurationHasSpecificValue ( ConfigurationType . Release , "Optimize" , "true" ) ;
48+ var projectPropertyGroups = new ProjectPropertyGroups ( projectLocation ) ;
49+ Convention . Is ( configurationHasSpecificValue , projectPropertyGroups ) ;
5350 }
5451 }
5552}
0 commit comments