Exemplo n.º 1
0
 public void FromMakefileProject()
 {
     using( TempResourceFile file = new TempResourceFile( this.GetType(), "resources.MakeFileProject.vcproj", "MakeFileProject.vcproj" ) )
     {
         NUnitProject project = NUnitProject.FromVSProject( file.Path );
         Assert.AreEqual( 2, project.Configs.Count );
         Assert.AreEqual( 1, project.Configs["Debug|Win32"].Assemblies.Count );
         Assert.AreEqual( 1, project.Configs["Release|Win32"].Assemblies.Count );
     }
 }
Exemplo n.º 2
0
		private void AssertCanLoadProject( string resourceName )
		{
			string fileName = Path.GetFileNameWithoutExtension( resourceName );
			using( TempResourceFile file = new TempResourceFile( this.GetType(), resourceDir + "." + resourceName, resourceName ) )
			{
				VSProject project = new VSProject( file.Path );
				Assert.AreEqual( fileName, project.Name );
				Assert.AreEqual( Path.GetFullPath( file.Path ), project.ProjectPath );
				Assert.AreEqual( fileName.ToLower(), Path.GetFileNameWithoutExtension( project.Configs[0].Assemblies[0].ToString().ToLower() ) );
			}
		}
Exemplo n.º 3
0
 public void GenerateCorrectExtensionsFromVCProjectVS2005()
 {
     using (TempResourceFile file = new TempResourceFile(this.GetType(), "resources.cpp-default-library_VS2005.vcproj", "cpp-default-library_VS2005.vcproj"))
     {
         VSProject project = new VSProject(file.Path);
         Assert.AreEqual("cpp-default-library_VS2005", project.Name);
         Assert.AreEqual(Path.GetFullPath(file.Path), project.ProjectPath);
         Assert.AreEqual(Path.GetFullPath( TestPath( @"debug/cpp-default-library_VS2005.dll" ) ).ToLower(),
             project.Configs["Debug|Win32"].Assemblies[0].ToString().ToLower());
         Assert.AreEqual(Path.GetFullPath( TestPath( @"release/cpp-default-library_VS2005.dll" ) ).ToLower(),
             project.Configs["Release|Win32"].Assemblies[0].ToString().ToLower());
     }
 }
		private void AssertCanLoadVsProject( string resourceName )
		{
			string fileName = Path.GetFileNameWithoutExtension( resourceName );
			using( TempResourceFile file = new TempResourceFile( this.GetType(), resourceDir + "." + resourceName, resourceName ) )
			{
				NUnitProject project = converter.ConvertFrom( file.Path );
				Assert.AreEqual( fileName, project.Name );
				Assert.AreEqual( project.Configs[0].Name, project.ActiveConfigName );
				Assert.AreEqual( fileName.ToLower(), Path.GetFileNameWithoutExtension( project.Configs[0].Assemblies[0].ToLower() ) );
				Assert.IsTrue( project.IsLoadable, "Not loadable" );
				Assert.IsFalse( project.IsDirty, "Project should not be dirty" );
			}
		}
		public void FromVSSolution2003()
		{
			using(new TempResourceFile(this.GetType(), "resources.csharp-sample.csproj", @"csharp\csharp-sample.csproj"))
			using(new TempResourceFile(this.GetType(), "resources.jsharp.vjsproj", @"jsharp\jsharp.vjsproj"))
			using(new TempResourceFile(this.GetType(), "resources.vb-sample.vbproj", @"vb\vb-sample.vbproj"))
			using(new TempResourceFile(this.GetType(), "resources.cpp-sample.vcproj", @"cpp-sample\cpp-sample.vcproj"))
			using(TempResourceFile file = new TempResourceFile(this.GetType(), "resources.samples.sln", "samples.sln" ))
			{
				NUnitProject project = converter.ConvertFrom( file.Path );
				Assert.AreEqual( 4, project.Configs.Count );
				Assert.AreEqual( 3, project.Configs["Debug"].Assemblies.Count );
				Assert.AreEqual( 3, project.Configs["Release"].Assemblies.Count );
				Assert.AreEqual( 1, project.Configs["Debug|Win32"].Assemblies.Count );
				Assert.AreEqual( 1, project.Configs["Release|Win32"].Assemblies.Count );
				Assert.IsTrue( project.IsLoadable, "Not loadable" );
				Assert.IsFalse( project.IsDirty, "Project should not be dirty" );
			}
		}
Exemplo n.º 6
0
 public void CreateTempFileName()
 {
     tempFile = "temp" + Guid.NewGuid().ToString() + ".xml";
     schemaFile = new TempResourceFile( GetType(), "Results.xsd");
 }
Exemplo n.º 7
0
 public void WithUnmanagedCpp()
 {
     using( new TempResourceFile( this.GetType(), "resources.ClassLibrary1.csproj", @"ClassLibrary1\ClassLibrary1.csproj" ) )
     using( new TempResourceFile( this.GetType(), "resources.Unmanaged.vcproj", @"Unmanaged\Unmanaged.vcproj" ) )
     using( TempResourceFile file = new TempResourceFile( this.GetType(), "resources.Solution1.sln", "Solution1.sln" ) )
     {
         NUnitProject project = NUnitProject.FromVSSolution( file.Path );
         Assert.AreEqual( 4, project.Configs.Count );
         Assert.AreEqual( 1, project.Configs["Debug"].Assemblies.Count );
         Assert.AreEqual( 1, project.Configs["Release"].Assemblies.Count );
         Assert.AreEqual( 1, project.Configs["Debug|Win32"].Assemblies.Count );
         Assert.AreEqual( 1, project.Configs["Release|Win32"].Assemblies.Count );
     }
 }
Exemplo n.º 8
0
 public void FromWebApplication()
 {
     using( new TempResourceFile(this.GetType(), "resources.ClassLibrary1.csproj", @"ClassLibrary1\ClassLibrary1.csproj" ) )
     using( TempResourceFile file = new TempResourceFile( this.GetType(), "resources.WebApplication1.sln", "WebApplication1.sln" ) )
     {
         NUnitProject project = NUnitProject.FromVSSolution( Path.GetFullPath( file.Path ) );
         Assert.AreEqual( 2, project.Configs.Count );
         Assert.AreEqual( 1, project.Configs["Debug"].Assemblies.Count );
         Assert.AreEqual( 1, project.Configs["Release"].Assemblies.Count );
     }
 }
Exemplo n.º 9
0
 public void LoadCppProjectWithMacros()
 {
     using ( TempResourceFile file = new TempResourceFile(this.GetType(), "resources.CPPLibrary.vcproj", "CPPLibrary.vcproj" ))
     {
         VSProject project = new VSProject(file.Path);
         Assert.AreEqual( "CPPLibrary", project.Name );
         Assert.AreEqual( Path.GetFullPath(file.Path), project.ProjectPath);
         Assert.AreEqual( Path.GetFullPath( @"debug\cpplibrary.dll" ).ToLower(),
             project.Configs["Debug|Win32"].Assemblies[0].ToString().ToLower());
         Assert.AreEqual( Path.GetFullPath( @"release\cpplibrary.dll" ).ToLower(),
             project.Configs["Release|Win32"].Assemblies[0].ToString().ToLower());
     }
 }
Exemplo n.º 10
0
 private void AssertCanLoadProject( string resourceName, params string[] configNames )
 {
     string fileName = Path.GetFileNameWithoutExtension( resourceName );
     using( TempResourceFile file = new TempResourceFile( this.GetType(), resourceDir + "." + resourceName, resourceName ) )
     {
         VSProject project = new VSProject( file.Path );
         Assert.AreEqual( fileName, project.Name );
         Assert.AreEqual( Path.GetFullPath( file.Path ), project.ProjectPath );
         Assert.AreEqual( fileName.ToLower(), Path.GetFileNameWithoutExtension( project.Configs[0].Assemblies[0].ToString().ToLower() ) );
         if ( configNames != null )
         {
             Assert.AreEqual( configNames.Length, project.Configs.Count );
             for( int index = 0; index < configNames.Length; index++ )
                 Assert.AreEqual( configNames[index], project.Configs[index].Name );
         }
     }
 }
Exemplo n.º 11
0
		public void CreateTempFileName()
		{
            tempFile = Path.GetTempFileName();
			schemaFile = new TempResourceFile( GetType(), "Results.xsd");
		}