public void VSSDKTest() { // Package not available on Linux if (OperatingSystem.Current == OperatingSystem.Linux) { return; } var csProj = new CsProj(this); csProj.ItemGroups.Add($@" <ItemGroup> <OpenTapPackageReference Include=""Visual Studio SDK"" Repository=""packages.opentap.io"" IncludeAssemblies=""**"" ExcludeAssemblies=""**/*Install**;**stdole**""/> </ItemGroup> "); var result = csProj.Build(); StringAssert.Contains("Got 1 OpenTapPackageReference targets.", result.Stdout); StringAssert.Contains(@"Visual Studio SDK Include=""**"" Exclude=""**/*Install**,**stdole**""", result.Stdout); Assert.AreEqual(result.ExitCode, 0); Assert.True(File.Exists(OutputFile)); var Generated = csProj.GetGeneratedFileContent(); StringAssert.DoesNotContain("OpenTap.VSSdk.Installer.dll", Generated); StringAssert.DoesNotContain("stdole.dll", Generated); StringAssert.Contains("OpenTap.VSSdk.Debugger.dll", Generated); StringAssert.Contains("EnvDTE.dll", Generated); }
public void TwoEqualReferencesDefaultTest() { var csProj = new CsProj(this); csProj.ItemGroups.Add($@" <ItemGroup> <OpenTapPackageReference Repository=""{FileRepository}"" Include=""MyPlugin4"" /> </ItemGroup> "); csProj.ItemGroups.Add($@" <ItemGroup> <OpenTapPackageReference Repository=""{FileRepository}"" Include=""MyPlugin5"" /> </ItemGroup> "); var result = csProj.Build(); StringAssert.Contains("Got 2 OpenTapPackageReference targets.", result.Stdout); StringAssert.Contains("MyPlugin4 Include=\"**\" Exclude=\"Dependencies/**\"", result.Stdout); StringAssert.Contains("MyPlugin5 Include=\"**\" Exclude=\"Dependencies/**\"", result.Stdout); Assert.AreEqual(result.ExitCode, 0); Assert.True(File.Exists(OutputFile)); var Generated = csProj.GetGeneratedFileContent(); StringAssert.Contains("MyPlugin4.dll", Generated); StringAssert.Contains("MyPlugin5.dll", Generated); }
public void TwoDifferentReferencesSpecifiedTest() { var csProj = new CsProj(this); csProj.ItemGroups.Add($@" <ItemGroup> <OpenTapPackageReference Include=""MyPlugin4""> <Repository>{FileRepository}</Repository> <IncludeAssemblies>test1;test2</IncludeAssemblies> <ExcludeAssemblies>test3;test4</ExcludeAssemblies> </OpenTapPackageReference> </ItemGroup> "); csProj.ItemGroups.Add($@" <ItemGroup> <OpenTapPackageReference Repository=""{FileRepository}"" Include=""MyPlugin5""> <IncludeAssemblies>test5;test6</IncludeAssemblies> <ExcludeAssemblies>test7;test8</ExcludeAssemblies> </OpenTapPackageReference> </ItemGroup> "); var result = csProj.Build(); StringAssert.Contains("Got 2 OpenTapPackageReference targets.", result.Stdout); StringAssert.Contains("MyPlugin4 Include=\"test1,test2\" Exclude=\"test3,test4\"", result.Stdout); StringAssert.Contains("MyPlugin5 Include=\"test5,test6\" Exclude=\"test7,test8\"", result.Stdout); Assert.AreEqual(result.ExitCode, 0); Assert.False(File.Exists(OutputFile)); }
public void NoReferencesTest() { var result = new CsProj(this).Build(); StringAssert.Contains("Got 0 OpenTapPackageReference targets.", result.Stdout); Assert.AreEqual(result.ExitCode, 0); Assert.False(File.Exists(OutputFile)); }