@@ -544,6 +544,36 @@ static FileVersionQuad ExpectedFileVersion( bool isPreRelease, bool isCiBuild )
544544 }
545545 }
546546
547+ [ TestMethod ]
548+ [ DataRow ( "netstandard2.0" ) ]
549+ [ DataRow ( "net48" ) ]
550+ [ DataRow ( "net8.0" ) ]
551+ public void Projects_with_project_references_create_proper_dependencies_in_nuspec ( string targetFramework )
552+ {
553+ // This tests for a fix to https://github.com/UbiquityDotNET/CSemVer.GitBuild/issues/79
554+ // Currently this is a bit of a hack to move things along elsewhere.
555+ // for now, hack this and specifically look for the solution that is at least known to work at this point.
556+ var globalProperties = new Dictionary < string , string >
557+ {
558+ [ PropertyNames . BuildMajor ] = "1" ,
559+ [ PropertyNames . BuildMinor ] = "2" ,
560+ [ PropertyNames . BuildPatch ] = "3" ,
561+ [ PropertyNames . PreReleaseName ] = "delta" ,
562+ } ;
563+
564+ using var collection = new ProjectCollection ( globalProperties ) ;
565+ using var fullResults = Context . CreateTestProjectAndInvokeTestedPackage ( targetFramework , collection ) ;
566+ var prop = fullResults . BuildResults . Creator . Project . GetProperty ( "GetPackageVersionDependsOn" ) ;
567+ Assert . IsTrue ( prop . EvaluatedValue . Contains ( "PrepareVersioningForBuild" , StringComparison . Ordinal ) ) ;
568+
569+ // A full solution would:
570+ // Create a project (dependentProj)
571+ // - Should generate a NuGetPackage
572+ // Create a project (testProj) that has a project reference for 'dependentProj'
573+ // pack testProj
574+ // look into generated nupkg to ensure dependency for dependentProj has correct version (and NOT the default 1.0.0)
575+ }
576+
547577 private static IEnumerable < PrereleaseTestData > GetPrereleaseTestData ( )
548578 {
549579 return from tfm in TargetFrameworks
0 commit comments