public void TestProcessProjectSwitchRemovedAllprojects() { Assert.Throws<InitializationException>(() => { string[] projects; string[] extensionsToIgnore = null; projects = new string[] { "test.nativeproj", "test.vcproj" }; extensionsToIgnore = new string[] { ".nativeproj", ".vcproj" }; IgnoreProjectExtensionsHelper projectHelper = new IgnoreProjectExtensionsHelper(projects); MSBuildApp.ProcessProjectSwitch(new string[0] { }, extensionsToIgnore, projectHelper.GetFiles); Assert.True(false); } ); }
public void TestProcessProjectSwitch() { string[] projects = new string[] { "test.nativeproj", "test.vcproj" }; string[] extensionsToIgnore = new string[] { ".phantomextension", ".vcproj" }; IgnoreProjectExtensionsHelper projectHelper = new IgnoreProjectExtensionsHelper(projects); Assert.Equal(0, String.Compare("test.nativeproj", MSBuildApp.ProcessProjectSwitch(new string[0] { }, extensionsToIgnore, projectHelper.GetFiles), StringComparison.OrdinalIgnoreCase)); // "Expected test.nativeproj to be only project found" projects = new string[] { "test.nativeproj", "test.vcproj", "test.proj" }; extensionsToIgnore = new string[] { ".phantomextension", ".vcproj" }; projectHelper = new IgnoreProjectExtensionsHelper(projects); Assert.Equal(0, String.Compare("test.proj", MSBuildApp.ProcessProjectSwitch(new string[0] { }, extensionsToIgnore, projectHelper.GetFiles), StringComparison.OrdinalIgnoreCase)); // "Expected test.proj to be only project found" projects = new string[] { "test.nativeproj", "test.vcproj" }; extensionsToIgnore = new string[] { ".vcproj" }; projectHelper = new IgnoreProjectExtensionsHelper(projects); Assert.Equal(0, String.Compare("test.nativeproj", MSBuildApp.ProcessProjectSwitch(new string[0] { }, extensionsToIgnore, projectHelper.GetFiles), StringComparison.OrdinalIgnoreCase)); // "Expected test.nativeproj to be only project found" projects = new string[] { "test.proj", "test.sln" }; extensionsToIgnore = new string[] { ".vcproj" }; projectHelper = new IgnoreProjectExtensionsHelper(projects); Assert.Equal(0, String.Compare("test.sln", MSBuildApp.ProcessProjectSwitch(new string[0] { }, extensionsToIgnore, projectHelper.GetFiles), StringComparison.OrdinalIgnoreCase)); // "Expected test.sln to be only solution found" projects = new string[] { "test.proj", "test.sln", "test.proj~", "test.sln~" }; extensionsToIgnore = new string[] { }; projectHelper = new IgnoreProjectExtensionsHelper(projects); Assert.Equal(0, String.Compare("test.sln", MSBuildApp.ProcessProjectSwitch(new string[0] { }, extensionsToIgnore, projectHelper.GetFiles), StringComparison.OrdinalIgnoreCase)); // "Expected test.sln to be only solution found" projects = new string[] { "test.proj" }; extensionsToIgnore = new string[] { }; projectHelper = new IgnoreProjectExtensionsHelper(projects); Assert.Equal(0, String.Compare("test.proj", MSBuildApp.ProcessProjectSwitch(new string[0] { }, extensionsToIgnore, projectHelper.GetFiles), StringComparison.OrdinalIgnoreCase)); // "Expected test.proj to be only project found" projects = new string[] { "test.proj", "test.proj~" }; extensionsToIgnore = new string[] { }; projectHelper = new IgnoreProjectExtensionsHelper(projects); Assert.Equal(0, String.Compare("test.proj", MSBuildApp.ProcessProjectSwitch(new string[0] { }, extensionsToIgnore, projectHelper.GetFiles), StringComparison.OrdinalIgnoreCase)); // "Expected test.proj to be only project found" projects = new string[] { "test.sln" }; extensionsToIgnore = new string[] { }; projectHelper = new IgnoreProjectExtensionsHelper(projects); Assert.Equal(0, String.Compare("test.sln", MSBuildApp.ProcessProjectSwitch(new string[0] { }, extensionsToIgnore, projectHelper.GetFiles), StringComparison.OrdinalIgnoreCase)); // "Expected test.sln to be only solution found" projects = new string[] { "test.sln", "test.sln~" }; extensionsToIgnore = new string[] { }; projectHelper = new IgnoreProjectExtensionsHelper(projects); Assert.Equal(0, String.Compare("test.sln", MSBuildApp.ProcessProjectSwitch(new string[0] { }, extensionsToIgnore, projectHelper.GetFiles), StringComparison.OrdinalIgnoreCase)); // "Expected test.sln to be only solution found" projects = new string[] { "test.sln~", "test.sln" }; extensionsToIgnore = new string[] { }; projectHelper = new IgnoreProjectExtensionsHelper(projects); Assert.Equal(0, String.Compare("test.sln", MSBuildApp.ProcessProjectSwitch(new string[0] { }, extensionsToIgnore, projectHelper.GetFiles), StringComparison.OrdinalIgnoreCase)); // "Expected test.sln to be only solution found" }
public void TestProcessProjectSwitchReplicateBuildingDFLKG() { string[] projects = new string[] { "test.proj", "test.sln", "Foo.vcproj" }; string[] extensionsToIgnore = { ".sln", ".vcproj" }; IgnoreProjectExtensionsHelper projectHelper = new IgnoreProjectExtensionsHelper(projects); Assert.Equal(0, String.Compare("test.proj", MSBuildApp.ProcessProjectSwitch(new string[0] { }, extensionsToIgnore, projectHelper.GetFiles), StringComparison.OrdinalIgnoreCase)); // "Expected test.proj to be only project found" }
public void TestProcessProjectSwitchMalformed() { Assert.Throws<InitializationException>(() => { string[] projects = new string[] { "my.proj" }; string[] extensionsToIgnore = new string[] { ".C:\\boocatmoo.a" }; IgnoreProjectExtensionsHelper projectHelper = new IgnoreProjectExtensionsHelper(projects); Assert.Equal(0, String.Compare("my.proj", MSBuildApp.ProcessProjectSwitch(new string[0] { }, extensionsToIgnore, projectHelper.GetFiles), StringComparison.OrdinalIgnoreCase)); // "Expected my.proj to be only project found" } ); }
public void TestProcessProjectSwitchWildcards() { Assert.Throws<InitializationException>(() => { string[] projects = new string[] { "my.proj" }; string[] extensionsToIgnore = new string[] { ".proj*", ".nativeproj?" }; IgnoreProjectExtensionsHelper projectHelper = new IgnoreProjectExtensionsHelper(projects); MSBuildApp.ProcessProjectSwitch(new string[0] { }, extensionsToIgnore, projectHelper.GetFiles); // Should not get here Assert.True(false); } ); }
public void TestProcessProjectSwitchExtensionWithoutDot() { string[] projects = new string[] { "my.proj" }; string[] extensionsToIgnore = new string[] { "phantomextension" }; IgnoreProjectExtensionsHelper projectHelper = new IgnoreProjectExtensionsHelper(projects); Assert.IsTrue(String.Compare("my.proj", MSBuildApp.ProcessProjectSwitch(new string[0] { }, extensionsToIgnore, projectHelper.GetFiles), StringComparison.OrdinalIgnoreCase) == 0); }
public void TestProcessProjectSwitchExtensionWithoutDot() { Assert.Throws<InitializationException>(() => { string[] projects = new string[] { "my.proj" }; string[] extensionsToIgnore = new string[] { "phantomextension" }; IgnoreProjectExtensionsHelper projectHelper = new IgnoreProjectExtensionsHelper(projects); Assert.Equal(0, String.Compare("my.proj", MSBuildApp.ProcessProjectSwitch(new string[0] { }, extensionsToIgnore, projectHelper.GetFiles), StringComparison.OrdinalIgnoreCase)); } ); }
public void TestProcessProjectSwitchNoProjectOrSolution() { string[] projects = new string[] { }; string[] extensionsToIgnore = null; IgnoreProjectExtensionsHelper projectHelper = new IgnoreProjectExtensionsHelper(projects); MSBuildApp.ProcessProjectSwitch(new string[0] { }, extensionsToIgnore, projectHelper.GetFiles); // Should not get here Assert.Fail(); }
public void TestTwoIdenticalExtensionsToIgnore() { string[] projects = new string[] { "my.proj" }; string[] extensionsToIgnore = new string[] { ".phantomextension", ".phantomextension" }; IgnoreProjectExtensionsHelper projectHelper = new IgnoreProjectExtensionsHelper(projects); Assert.Equal(0, String.Compare("my.proj", MSBuildApp.ProcessProjectSwitch(new string[0] { }, extensionsToIgnore, projectHelper.GetFiles), StringComparison.OrdinalIgnoreCase)); // "Expected my.proj to be only project found" }
public void TestProcessProjectSwitchSlnProjDifferentNames() { string[] projects = new string[] { "test.proj", "Different.sln" }; string[] extensionsToIgnore = null; IgnoreProjectExtensionsHelper projectHelper = new IgnoreProjectExtensionsHelper(projects); MSBuildApp.ProcessProjectSwitch(new string[0] { }, extensionsToIgnore, projectHelper.GetFiles); // Should not get here Assert.Fail(); }
public void TestProcessProjectSwitchMoreThenTwoProj() { string[] projects = new string[] { "test.nativeproj", "Different.csproj", "Another.proj" }; string[] extensionsToIgnore = null; IgnoreProjectExtensionsHelper projectHelper = new IgnoreProjectExtensionsHelper(projects); MSBuildApp.ProcessProjectSwitch(new string[0] { }, extensionsToIgnore, projectHelper.GetFiles); // Should not get here Assert.Fail(); }
public void TestProcessProjectSwitchRemovedAllprojects() { string[] projects; string[] extensionsToIgnore = null; projects = new string[] { "test.nativeproj", "test.vcproj" }; extensionsToIgnore = new string[] { ".nativeproj", ".vcproj" }; IgnoreProjectExtensionsHelper projectHelper = new IgnoreProjectExtensionsHelper(projects); MSBuildApp.ProcessProjectSwitch(new string[0] { }, extensionsToIgnore, projectHelper.GetFiles); Assert.Fail(); }
public void TestProcessProjectSwitchWildcards() { string[] projects = new string[] { "my.proj" }; string[] extensionsToIgnore = new string[] { ".proj*", ".nativeproj?" }; IgnoreProjectExtensionsHelper projectHelper = new IgnoreProjectExtensionsHelper(projects); MSBuildApp.ProcessProjectSwitch(new string[0] { }, extensionsToIgnore, projectHelper.GetFiles); // Should not get here Assert.Fail(); }
public void TestProcessProjectSwitchMalformed() { string[] projects = new string[] { "my.proj" }; string[] extensionsToIgnore = new string[] { ".C:\\boocatmoo.a" }; IgnoreProjectExtensionsHelper projectHelper = new IgnoreProjectExtensionsHelper(projects); Assert.IsTrue(String.Compare("my.proj", MSBuildApp.ProcessProjectSwitch(new string[0] { }, extensionsToIgnore, projectHelper.GetFiles), StringComparison.OrdinalIgnoreCase) == 0, "Expected my.proj to be only project found"); }
public void TestProcessProjectSwitchMoreThenTwoProj() { Assert.Throws<InitializationException>(() => { string[] projects = new string[] { "test.nativeproj", "Different.csproj", "Another.proj" }; string[] extensionsToIgnore = null; IgnoreProjectExtensionsHelper projectHelper = new IgnoreProjectExtensionsHelper(projects); MSBuildApp.ProcessProjectSwitch(new string[0] { }, extensionsToIgnore, projectHelper.GetFiles); // Should not get here Assert.True(false); } ); }
public void TestProcessProjectSwitchNullandEmptyProjectsToIgnore() { string[] projects = new string[] { "my.proj" }; string[] extensionsToIgnore = (string[])null; IgnoreProjectExtensionsHelper projectHelper = new IgnoreProjectExtensionsHelper(projects); Assert.Equal(0, String.Compare("my.proj", MSBuildApp.ProcessProjectSwitch(new string[0] { }, extensionsToIgnore, projectHelper.GetFiles), StringComparison.OrdinalIgnoreCase)); // "Expected my.proj to be only project found" extensionsToIgnore = new string[] { }; Assert.Equal(0, String.Compare("my.proj", MSBuildApp.ProcessProjectSwitch(new string[0] { }, extensionsToIgnore, projectHelper.GetFiles), StringComparison.OrdinalIgnoreCase)); // "Expected my.proj to be only project found" }
public void TestProcessProjectSwitchNoProjectOrSolution() { Assert.Throws<InitializationException>(() => { string[] projects = new string[] { }; string[] extensionsToIgnore = null; IgnoreProjectExtensionsHelper projectHelper = new IgnoreProjectExtensionsHelper(projects); MSBuildApp.ProcessProjectSwitch(new string[0] { }, extensionsToIgnore, projectHelper.GetFiles); // Should not get here Assert.True(false); } ); }
public void TestProcessProjectSwitchEmptyInList() { string[] projects = new string[] { "my.proj" }; string[] extensionsToIgnore = new string[] { ".phantomextension", string.Empty }; IgnoreProjectExtensionsHelper projectHelper = new IgnoreProjectExtensionsHelper(projects); Assert.IsTrue(String.Compare("my.proj", MSBuildApp.ProcessProjectSwitch(new string[0] { }, extensionsToIgnore, projectHelper.GetFiles), StringComparison.OrdinalIgnoreCase) == 0, "Expected my.proj to be only project found"); }