diff --git a/.vssbe b/.vssbe
index 25f9b6d..9d26a2d 100644
--- a/.vssbe
+++ b/.vssbe
@@ -185,9 +185,9 @@
"Mode": {
"$type": "net.r_eg.vsSBE.Events.ModeScript, vsSolutionBuildEvent",
"Type": "Script",
- "Command": "#[( $(Configuration) != \"PublicRelease\" ) {\n #[IO replace.Regex(\"$(pDir)/MvsSlnVersion.cs\", \"(\\sS_NUM\\s=).+?\\\";\", \"$1 \\\"$(pVer)\\\";\")]\n}]\n\n#[IO replace.Regex(\"$(pDir)/MvsSln.csproj\", \".+?\", \"$(pVer)\")]",
+ "Command": "#[( ! $(isCIBuild) ) {\n #[IO replace.Regex(\"$(pDir)/MvsSlnVersion.cs\", \"(\\sS_NUM\\s=).+?\\\";\", \"$1 \\\"$(pVer)\\\";\")]\n}]\n\n#[IO replace.Regex(\"$(pDir)/MvsSln.csproj\", \".+?\", \"$(pVer)\")]",
"Command__": [
- "#[( $(Configuration) != \"PublicRelease\" ) {",
+ "#[( ! $(isCIBuild) ) {",
" #[IO replace.Regex(\"$(pDir)/MvsSlnVersion.cs\", \"(\\sS_NUM\\s=).+?\\\";\", \"$1 \\\"$(pVer)\\\";\")]",
"}]",
"",
@@ -393,7 +393,7 @@
"Mode": {
"$type": "net.r_eg.vsSBE.Events.ModeScript, vsSolutionBuildEvent",
"Type": "Script",
- "Command": "#[IO copy.file(\n \"$(SolutionDir)tools/*.*\", \n \"$(odir)/tools/\", \n true, \n {\"*.nuspec\"})]\n\n##[IO copy.file(\"tools/MvsSln.nuspec\", \"$(odir)/MvsSln.nuspec\", true)]\n##[IO copy.file(\"$(pDir)/$(OutputPath:$(pDir))/*.*\", \n \"$(odir)/lib/net$(netstamp)/\", true)]\n\n#[IO copy.file(\n {\"License.txt\", \"3rd-party.txt\", \"Readme.md\", \"changelog.txt\", \".version\", \"$(pDir)/obj/build-info.txt\"}, \n \"$(odir)/\", true\n)]\n\n#[$(_targets = $(TargetFrameworks))]\n#[$(_loop = true)]\n\n#[Box iterate(i = 0; $(_loop); i += 1): \n #[try\n {\n \n #[$(_target = $(_targets.Split(\";\")[$(i)]))]\n \n #[IO copy.file\n (\n \"$(pDir)/$(OutputPath:$(pDir))/$(_target)/*.*\", \n \"$(odir)/lib/$(_target)/\", \n true,\n {\"*.json\"}\n )]\n }\n catch { $(_loop = false) }]\n]\n",
+ "Command": "#[IO copy.file(\n \"$(SolutionDir)tools/*.*\", \n \"$(odir)/tools/\", \n true, \n {\"*.nuspec\"})]\n\n##[IO copy.file(\"tools/MvsSln.nuspec\", \"$(odir)/MvsSln.nuspec\", true)]\n##[IO copy.file(\"$(pDir)/$(OutputPath:$(pDir))/*.*\", \n \"$(odir)/lib/net$(netstamp)/\", true)]\n\n#[IO copy.file(\n {\"License.txt\", \"3rd-party.txt\", \"Readme.md\", \"changelog.txt\", \".version\", \"$(pDir)/obj/build-info.txt\"}, \n \"$(odir)/\", true\n)]\n\n#[( $(cfgname) == \"Release\" )\n{\n\n #[$(_targets = $(TargetFrameworks))]\n #[$(_loop = true)]\n \n #[Box iterate(i = 0; $(_loop); i += 1): \n #[try\n {\n \n #[$(_target = $(_targets.Split(\";\")[$(i)]))]\n \n #[IO copy.file\n (\n \"$(pDir)/$(OutputPath:$(pDir))/$(_target)/*.*\", \n \"$(odir)/lib/$(_target)/\", \n true,\n {\"*.json\"}\n )]\n }\n catch { $(_loop = false) }]\n ]\n \n}]\n\n",
"Command__": [
"#[IO copy.file(",
" \"$(SolutionDir)tools/*.*\", ",
@@ -410,25 +410,31 @@
" \"$(odir)/\", true",
")]",
"",
- "#[$(_targets = $(TargetFrameworks))]",
- "#[$(_loop = true)]",
+ "#[( $(cfgname) == \"Release\" )",
+ "{",
"",
- "#[Box iterate(i = 0; $(_loop); i += 1): ",
- " #[try",
- " {",
+ " #[$(_targets = $(TargetFrameworks))]",
+ " #[$(_loop = true)]",
" ",
- " #[$(_target = $(_targets.Split(\";\")[$(i)]))]",
+ " #[Box iterate(i = 0; $(_loop); i += 1): ",
+ " #[try",
+ " {",
+ " ",
+ " #[$(_target = $(_targets.Split(\";\")[$(i)]))]",
+ " ",
+ " #[IO copy.file",
+ " (",
+ " \"$(pDir)/$(OutputPath:$(pDir))/$(_target)/*.*\", ",
+ " \"$(odir)/lib/$(_target)/\", ",
+ " true,",
+ " {\"*.json\"}",
+ " )]",
+ " }",
+ " catch { $(_loop = false) }]",
+ " ]",
" ",
- " #[IO copy.file",
- " (",
- " \"$(pDir)/$(OutputPath:$(pDir))/$(_target)/*.*\", ",
- " \"$(odir)/lib/$(_target)/\", ",
- " true,",
- " {\"*.json\"}",
- " )]",
- " }",
- " catch { $(_loop = false) }]",
- "]",
+ "}]",
+ "",
""
]
}
@@ -456,20 +462,26 @@
"Mode": {
"$type": "net.r_eg.vsSBE.Events.ModeScript, vsSolutionBuildEvent",
"Type": "Script",
- "Command": "##[IO replace(\"$(odir)/MvsSln.nuspec\", \"{build_info}\", \"$(buildInfo)\")]\n\n##[NuGet gnt.raw(\"/t:pack /p:ngin=\\\"$(odir)\\\" /p:ngout=\\\"$(dbin)\\\"\")]\n\n#[($(revBuild) == \"\" || $(revBuild) ~= \"*\") {\n #[$(zipname = \"MvsSln.$(pVer).zip\")]\n}\nelse {\n #[$(zipname = \"MvsSln.$(pVer).$(revBuild)+$(bSha1).zip\")]\n}]\n\n#[7z pack.directory(\"$(odir)\", \"$(dbin)\\\\$(zipname)\")]\n\n#[IO copy.file\n(\n \"$(pDir)/$(OutputPath:$(pDir))/*$(pVer).nupkg\",\n \"$(dbin)/\", \n true \n)]",
+ "Command": "##[IO replace(\"$(odir)/MvsSln.nuspec\", \"{build_info}\", \"$(buildInfo)\")]\n\n##[NuGet gnt.raw(\"/t:pack /p:ngin=\\\"$(odir)\\\" /p:ngout=\\\"$(dbin)\\\"\")]\n\n#[( $(cfgname) == \"Release\" )\n{\n \n #[($(revBuild) == \"\" || $(revBuild) ~= \"*\") {\n #[$(zipname = \"MvsSln.$(pVer).zip\")]\n }\n else {\n #[$(zipname = \"MvsSln.$(pVer).$(revBuild)+$(bSha1).zip\")]\n }]\n \n #[7z pack.directory(\"$(odir)\", \"$(dbin)\\\\$(zipname)\")]\n\n}]\n\n\n#[IO copy.file\n(\n \"$(pDir)/$(OutputPath:$(pDir))/*$(pVer).nupkg\",\n \"$(dbin)/\", \n true \n)]",
"Command__": [
"##[IO replace(\"$(odir)/MvsSln.nuspec\", \"{build_info}\", \"$(buildInfo)\")]",
"",
"##[NuGet gnt.raw(\"/t:pack /p:ngin=\\\"$(odir)\\\" /p:ngout=\\\"$(dbin)\\\"\")]",
"",
- "#[($(revBuild) == \"\" || $(revBuild) ~= \"*\") {",
- " #[$(zipname = \"MvsSln.$(pVer).zip\")]",
- "}",
- "else {",
- " #[$(zipname = \"MvsSln.$(pVer).$(revBuild)+$(bSha1).zip\")]",
+ "#[( $(cfgname) == \"Release\" )",
+ "{",
+ " ",
+ " #[($(revBuild) == \"\" || $(revBuild) ~= \"*\") {",
+ " #[$(zipname = \"MvsSln.$(pVer).zip\")]",
+ " }",
+ " else {",
+ " #[$(zipname = \"MvsSln.$(pVer).$(revBuild)+$(bSha1).zip\")]",
+ " }]",
+ " ",
+ " #[7z pack.directory(\"$(odir)\", \"$(dbin)\\\\$(zipname)\")]",
+ "",
"}]",
"",
- "#[7z pack.directory(\"$(odir)\", \"$(dbin)\\\\$(zipname)\")]",
"",
"#[IO copy.file",
"(",
diff --git a/3rd-party.txt b/3rd-party.txt
index f179a81..cd32bc2 100644
--- a/3rd-party.txt
+++ b/3rd-party.txt
@@ -22,8 +22,8 @@ MvsSln [ https://github.com/3F/MvsSln ]
* vsSolutionBuildEvent
https://github.com/3F/vsSolutionBuildEvent
- * MSTest Framework
- https://github.com/microsoft/testfx
+ * xUnit.net
+ https://github.com/xunit/xunit
* hMSBuild
https://github.com/3F/hMSBuild
diff --git a/MvsSlnTest/Core/ConfigItemTest.cs b/MvsSlnTest/Core/ConfigItemTest.cs
index f5c4c70..1c14216 100644
--- a/MvsSlnTest/Core/ConfigItemTest.cs
+++ b/MvsSlnTest/Core/ConfigItemTest.cs
@@ -1,124 +1,123 @@
-using Microsoft.VisualStudio.TestTools.UnitTesting;
-using net.r_eg.MvsSln.Core;
+using net.r_eg.MvsSln.Core;
+using Xunit;
-namespace net.r_eg.MvsSlnTest.Core
+namespace MvsSlnTest.Core
{
- [TestClass]
public class ConfigItemTest
{
- [TestMethod]
+ [Fact]
public void EqTest1()
{
ConfigItem target1 = new ConfigItem("Debug", "Any CPU");
- Assert.AreEqual("Debug", target1.Configuration);
- Assert.AreEqual("Debug", target1.ConfigurationByRule);
- Assert.AreEqual("Any CPU", target1.Platform);
- Assert.AreEqual("AnyCPU", target1.PlatformByRule);
+ Assert.Equal("Debug", target1.Configuration);
+ Assert.Equal("Debug", target1.ConfigurationByRule);
+ Assert.Equal("Any CPU", target1.Platform);
+ Assert.Equal("AnyCPU", target1.PlatformByRule);
- Assert.AreEqual(target1, new ConfigItem("Debug", "Any CPU"));
- Assert.AreEqual(target1, new ConfigItem("Debug", "AnyCPU"));
- Assert.AreEqual(target1, new ConfigItem("deBUG", "anycpu"));
- Assert.AreNotEqual(target1, new ConfigItem("Release", "Any CPU"));
- Assert.AreNotEqual(target1, new ConfigItem("Debug", "Any CP"));
+ Assert.Equal(target1, new ConfigItem("Debug", "Any CPU"));
+ Assert.Equal(target1, new ConfigItem("Debug", "AnyCPU"));
+ Assert.Equal(target1, new ConfigItem("deBUG", "anycpu"));
+ Assert.NotEqual(target1, new ConfigItem("Release", "Any CPU"));
+ Assert.NotEqual(target1, new ConfigItem("Debug", "Any CP"));
}
- [TestMethod]
+ [Fact]
public void EqTest2()
{
var target1 = new ConfigItem("Config1|Platform1");
- Assert.AreEqual("Config1", target1.Configuration);
- Assert.AreEqual("Platform1", target1.Platform);
+ Assert.Equal("Config1", target1.Configuration);
+ Assert.Equal("Platform1", target1.Platform);
var target2 = new ConfigItem(null);
- Assert.AreEqual(null, target2.Configuration);
- Assert.AreEqual(null, target2.ConfigurationByRule);
- Assert.AreEqual(null, target2.Platform);
- Assert.AreEqual(null, target2.PlatformByRule);
+ Assert.Null(target2.Configuration);
+ Assert.Null(target2.ConfigurationByRule);
+ Assert.Null(target2.Platform);
+ Assert.Null(target2.PlatformByRule);
var target3 = new ConfigItem("Config1", "Platform1");
- Assert.AreEqual("Config1|Platform1", target3.ToString());
- Assert.AreEqual("Config1|Platform1", target3.Format());
+ Assert.Equal("Config1|Platform1", target3.ToString());
+ Assert.Equal("Config1|Platform1", target3.Format());
}
- [TestMethod]
+ [Fact]
public void EqRuleTest1()
{
var target = new ConfigItem("Debug", "Any CPU");
- Assert.AreEqual("Debug", target.Configuration);
- Assert.AreEqual("Debug", target.ConfigurationByRule);
- Assert.AreEqual("Any CPU", target.Platform);
- Assert.AreEqual("AnyCPU", target.PlatformByRule);
+ Assert.Equal("Debug", target.Configuration);
+ Assert.Equal("Debug", target.ConfigurationByRule);
+ Assert.Equal("Any CPU", target.Platform);
+ Assert.Equal("AnyCPU", target.PlatformByRule);
}
- [TestMethod]
+ [Fact]
public void EqRuleTest2()
{
- Assert.AreEqual(new ConfigItem("Debug", "Platform1"), new ConfigItem("deBUG", "platFORM1") { SensitivityComparing = true });
- Assert.AreEqual(new ConfigItem("Debug", "Platform1") { SensitivityComparing = true }, new ConfigItem("deBUG", "platFORM1") { SensitivityComparing = true });
+ Assert.Equal(new ConfigItem("Debug", "Platform1"), new ConfigItem("deBUG", "platFORM1") { SensitivityComparing = true });
+ Assert.Equal(new ConfigItem("Debug", "Platform1") { SensitivityComparing = true }, new ConfigItem("deBUG", "platFORM1") { SensitivityComparing = true });
- Assert.AreNotEqual(new ConfigItem("Debug", "Platform1"), new ConfigItem("deBUG", "platFORM1") { SensitivityComparing = false });
- Assert.AreNotEqual(new ConfigItem("Debug", "Platform1") { SensitivityComparing = false }, new ConfigItem("deBUG", "platFORM1") { SensitivityComparing = false });
- Assert.AreNotEqual(new ConfigItem("Debug", "Platform1") { SensitivityComparing = false }, new ConfigItem("deBUG", "platFORM1") { SensitivityComparing = true });
+ Assert.NotEqual(new ConfigItem("Debug", "Platform1"), new ConfigItem("deBUG", "platFORM1") { SensitivityComparing = false });
+ Assert.NotEqual(new ConfigItem("Debug", "Platform1") { SensitivityComparing = false }, new ConfigItem("deBUG", "platFORM1") { SensitivityComparing = false });
+ Assert.NotEqual(new ConfigItem("Debug", "Platform1") { SensitivityComparing = false }, new ConfigItem("deBUG", "platFORM1") { SensitivityComparing = true });
}
- [TestMethod]
+ [Fact]
public void IsEqualByRuleTest1()
{
var target = new ConfigItem("Debug", "Any CPU");
- Assert.AreEqual(true, target.IsEqualByRule("Debug", "Any CPU", false));
- Assert.AreEqual(false, target.IsEqualByRule("debug", "Any CPU", false));
+ Assert.True(target.IsEqualByRule("Debug", "Any CPU", false));
+ Assert.False(target.IsEqualByRule("debug", "Any CPU", false));
- Assert.AreEqual(true, target.IsEqualByRule("Debug", "AnyCPU", false));
- Assert.AreEqual(false, target.IsEqualByRule("Debug", "Anycpu", false));
+ Assert.True(target.IsEqualByRule("Debug", "AnyCPU", false));
+ Assert.False(target.IsEqualByRule("Debug", "Anycpu", false));
- Assert.AreEqual(true, target.IsEqualByRule("Debug", "Anycpu", true));
+ Assert.True(target.IsEqualByRule("Debug", "Anycpu", true));
- Assert.AreEqual(false, target.IsEqualByRule(null, null, false));
- Assert.AreEqual(false, target.IsEqualByRule(null, null, true));
+ Assert.False(target.IsEqualByRule(null, null, false));
+ Assert.False(target.IsEqualByRule(null, null, true));
}
- [TestMethod]
+ [Fact]
public void NoPlatformTest1()
{
var target = new ConfigItem("Config");
- Assert.AreEqual("Config", target.Configuration);
- Assert.AreEqual(string.Empty, target.Platform);
+ Assert.Equal("Config", target.Configuration);
+ Assert.Equal(string.Empty, target.Platform);
target = new ConfigItem("Config|");
- Assert.AreEqual("Config", target.Configuration);
- Assert.AreEqual(string.Empty, target.Platform);
+ Assert.Equal("Config", target.Configuration);
+ Assert.Equal(string.Empty, target.Platform);
target = new ConfigItem("Config| ");
- Assert.AreEqual("Config", target.Configuration);
- Assert.AreEqual(" ", target.Platform);
+ Assert.Equal("Config", target.Configuration);
+ Assert.Equal(" ", target.Platform);
}
- [TestMethod]
+ [Fact]
public void CtorTest1()
{
var target = new ConfigItem("");
- Assert.AreEqual(string.Empty, target.Configuration);
- Assert.AreEqual(string.Empty, target.Platform);
+ Assert.Equal(string.Empty, target.Configuration);
+ Assert.Equal(string.Empty, target.Platform);
target = new ConfigItem(" ");
- Assert.AreEqual(" ", target.Configuration);
- Assert.AreEqual(string.Empty, target.Platform);
+ Assert.Equal(" ", target.Configuration);
+ Assert.Equal(string.Empty, target.Platform);
target = new ConfigItem(null);
- Assert.AreEqual(null, target.Configuration);
- Assert.AreEqual(null, target.Platform);
+ Assert.Null(target.Configuration);
+ Assert.Null(target.Platform);
}
}
}
diff --git a/MvsSlnTest/Core/ObjHandlers/WExtensibilityGlobalsTest.cs b/MvsSlnTest/Core/ObjHandlers/WExtensibilityGlobalsTest.cs
index 19cfd34..3b1b18a 100644
--- a/MvsSlnTest/Core/ObjHandlers/WExtensibilityGlobalsTest.cs
+++ b/MvsSlnTest/Core/ObjHandlers/WExtensibilityGlobalsTest.cs
@@ -1,22 +1,21 @@
using System;
using System.Collections.Generic;
-using Microsoft.VisualStudio.TestTools.UnitTesting;
using net.r_eg.MvsSln.Core.ObjHandlers;
+using Xunit;
-namespace net.r_eg.MvsSlnTest.Core.ObjHandlers
+namespace MvsSlnTest.Core.ObjHandlers
{
- [TestClass]
public class WExtensibilityGlobalsTest
{
- [TestMethod]
+ [Fact]
public void ExtractTest1()
{
- var target = (new WExtensibilityGlobals(null)).Extract(null);
+ var target = new WExtensibilityGlobals(null).Extract(null);
- Assert.AreEqual(String.Empty, target);
+ Assert.Equal(String.Empty, target);
}
- [TestMethod]
+ [Fact]
public void ExtractTest2()
{
var actual = new Dictionary()
@@ -28,7 +27,7 @@ public void ExtractTest2()
};
var target = (new WExtensibilityGlobals(actual)).Extract(null);
- Assert.AreEqual(SlnSamplesResource.Section_WExtensibilityGlobals_Test, target);
+ Assert.Equal(SlnSamplesResource.Section_WExtensibilityGlobals_Test, target);
}
}
}
diff --git a/MvsSlnTest/Core/ObjHandlers/WNestedProjectsTest.cs b/MvsSlnTest/Core/ObjHandlers/WNestedProjectsTest.cs
index a4f2629..7131a77 100644
--- a/MvsSlnTest/Core/ObjHandlers/WNestedProjectsTest.cs
+++ b/MvsSlnTest/Core/ObjHandlers/WNestedProjectsTest.cs
@@ -1,12 +1,11 @@
using System;
using System.Collections.Generic;
-using Microsoft.VisualStudio.TestTools.UnitTesting;
using net.r_eg.MvsSln.Core;
using net.r_eg.MvsSln.Core.ObjHandlers;
+using Xunit;
-namespace net.r_eg.MvsSlnTest.Core.ObjHandlers
+namespace MvsSlnTest.Core.ObjHandlers
{
- [TestClass]
public class WNestedProjectsTest
{
protected List folders = new List()
@@ -25,16 +24,16 @@ public class WNestedProjectsTest
new ProjectItem("{C1A3BCC3-F120-471D-A31E-4B835A06F42D}", "Project4", ProjectType.Vc),
};
- [TestMethod]
+ [Fact]
public void ExtractTest1()
{
IEnumerable sf = null;
var target = (new WNestedProjects(sf)).Extract(null);
- Assert.AreEqual(String.Empty, target);
+ Assert.Equal(String.Empty, target);
}
- [TestMethod]
+ [Fact]
public void ExtractTest2()
{
ResetData();
@@ -45,10 +44,10 @@ public void ExtractTest2()
var target = (new WNestedProjects(folders)).Extract(null);
- Assert.AreEqual(SlnSamplesResource.Section_WNestedProjects_Test2, target);
+ Assert.Equal(SlnSamplesResource.Section_WNestedProjects_Test2, target);
}
- [TestMethod]
+ [Fact]
public void ExtractTest3()
{
ResetData();
@@ -59,10 +58,10 @@ public void ExtractTest3()
var target = (new WNestedProjects(projects)).Extract(null);
- Assert.AreEqual(SlnSamplesResource.Section_WNestedProjects_Test3, target);
+ Assert.Equal(SlnSamplesResource.Section_WNestedProjects_Test3, target);
}
- [TestMethod]
+ [Fact]
public void ExtractTest4()
{
ResetData();
@@ -77,7 +76,7 @@ public void ExtractTest4()
var target = (new WNestedProjects(folders, projects)).Extract(null);
- Assert.AreEqual(SlnSamplesResource.Section_WNestedProjects_Test4, target);
+ Assert.Equal(SlnSamplesResource.Section_WNestedProjects_Test4, target);
}
protected void ResetData()
diff --git a/MvsSlnTest/Core/ObjHandlers/WProjectConfigurationPlatformsTest.cs b/MvsSlnTest/Core/ObjHandlers/WProjectConfigurationPlatformsTest.cs
index 0a4415d..e1a32a4 100644
--- a/MvsSlnTest/Core/ObjHandlers/WProjectConfigurationPlatformsTest.cs
+++ b/MvsSlnTest/Core/ObjHandlers/WProjectConfigurationPlatformsTest.cs
@@ -1,14 +1,13 @@
using System.Collections.Generic;
-using Microsoft.VisualStudio.TestTools.UnitTesting;
using net.r_eg.MvsSln.Core;
using net.r_eg.MvsSln.Core.ObjHandlers;
+using Xunit;
-namespace net.r_eg.MvsSlnTest.Core.ObjHandlers
+namespace MvsSlnTest.Core.ObjHandlers
{
- [TestClass]
public class WProjectConfigurationPlatformsTest
{
- [TestMethod]
+ [Fact]
public void ExtractTest1()
{
var data = new List() {
@@ -20,7 +19,7 @@ public void ExtractTest1()
var target = (new WProjectConfigurationPlatforms(data)).Extract(null);
- Assert.AreEqual(SlnSamplesResource.Section_Prj_Config, target);
+ Assert.Equal(SlnSamplesResource.Section_Prj_Config, target);
}
}
}
diff --git a/MvsSlnTest/Core/ObjHandlers/WProjectSolutionItemsTest.cs b/MvsSlnTest/Core/ObjHandlers/WProjectSolutionItemsTest.cs
index d8db1fc..d12cf7f 100644
--- a/MvsSlnTest/Core/ObjHandlers/WProjectSolutionItemsTest.cs
+++ b/MvsSlnTest/Core/ObjHandlers/WProjectSolutionItemsTest.cs
@@ -1,14 +1,13 @@
using System.Collections.Generic;
-using Microsoft.VisualStudio.TestTools.UnitTesting;
using net.r_eg.MvsSln.Core;
using net.r_eg.MvsSln.Core.ObjHandlers;
+using Xunit;
-namespace net.r_eg.MvsSlnTest.Core.ObjHandlers
+namespace MvsSlnTest.Core.ObjHandlers
{
- [TestClass]
public class WProjectSolutionItemsTest
{
- [TestMethod]
+ [Fact]
public void ExtractTest1()
{
var data = new List()
@@ -46,7 +45,7 @@ public void ExtractTest1()
var target = (new WProjectSolutionItems(data)).Extract(null);
- Assert.AreEqual(SlnSamplesResource.Section_Sln_Items, target);
+ Assert.Equal(SlnSamplesResource.Section_Sln_Items, target);
}
}
}
diff --git a/MvsSlnTest/Core/ObjHandlers/WProjectTest.cs b/MvsSlnTest/Core/ObjHandlers/WProjectTest.cs
index 7e9e31f..1588d21 100644
--- a/MvsSlnTest/Core/ObjHandlers/WProjectTest.cs
+++ b/MvsSlnTest/Core/ObjHandlers/WProjectTest.cs
@@ -1,23 +1,22 @@
using System.Collections.Generic;
-using Microsoft.VisualStudio.TestTools.UnitTesting;
using net.r_eg.MvsSln.Core;
using net.r_eg.MvsSln.Core.ObjHandlers;
+using Xunit;
-namespace net.r_eg.MvsSlnTest.Core.ObjHandlers
+namespace MvsSlnTest.Core.ObjHandlers
{
- [TestClass]
public class WProjectTest
{
- [TestMethod]
+ [Fact]
public void ExtractTest1()
{
var data = new _WProjectTestData();
var target = (new WProject(data.ProjectItems, data)).Extract(null);
- Assert.AreEqual(SlnSamplesResource.Section_Project_Dep, target);
+ Assert.Equal(SlnSamplesResource.Section_Project_Dep, target);
string firstLine = target.Substring(0, target.IndexOfAny(new[] { '\r', '\n' }));
- Assert.AreEqual(true, RPatterns.ProjectLine.IsMatch(firstLine));
+ Assert.Matches(RPatterns.ProjectLine, firstLine);
}
private class _WProjectTestData: ISlnProjectDependencies
@@ -36,19 +35,22 @@ public _WProjectTestData()
{
var pItems = new List()
{
- new ProjectItem() {
+ new ProjectItem()
+ {
pType = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}",
name = "Bridge",
path = "Bridge\\Bridge.csproj",
pGuid = "{73919171-44B6-4536-B892-F1FCA653887C}"
},
- new ProjectItem() {
+ new ProjectItem()
+ {
pType = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}",
name = "CIMLib",
path = "CIMLib\\CIMLib.csproj",
pGuid = "{A7BF1F9C-F18D-423E-9354-859DC3CFAFD4}"
},
- new ProjectItem() {
+ new ProjectItem()
+ {
pType = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}",
name = "Provider",
path = "Provider\\Provider.csproj",
@@ -58,21 +60,25 @@ public _WProjectTestData()
ProjectItems = pItems;
- Projects = new Dictionary() {
+ Projects = new Dictionary()
+ {
[pItems[0].pGuid] = pItems[0],
[pItems[1].pGuid] = pItems[1],
[pItems[2].pGuid] = pItems[2]
};
- Dependencies = new Dictionary>() {
+ Dependencies = new Dictionary>()
+ {
[pItems[0].pGuid] = new HashSet(),
- [pItems[1].pGuid] = new HashSet() {
+ [pItems[1].pGuid] = new HashSet()
+ {
"{73919171-44B6-4536-B892-F1FCA653887C}",
"{4F8BB8CD-1116-4F07-9B8F-06D69FB8589B}"
- },
- [pItems[2].pGuid] = new HashSet() {
+ },
+ [pItems[2].pGuid] = new HashSet()
+ {
"{73919171-44B6-4536-B892-F1FCA653887C}"
- }
+ }
};
}
}
diff --git a/MvsSlnTest/Core/ObjHandlers/WSolutionConfigurationPlatformsTest.cs b/MvsSlnTest/Core/ObjHandlers/WSolutionConfigurationPlatformsTest.cs
index 60e233a..53b57c7 100644
--- a/MvsSlnTest/Core/ObjHandlers/WSolutionConfigurationPlatformsTest.cs
+++ b/MvsSlnTest/Core/ObjHandlers/WSolutionConfigurationPlatformsTest.cs
@@ -1,17 +1,17 @@
using System.Collections.Generic;
-using Microsoft.VisualStudio.TestTools.UnitTesting;
using net.r_eg.MvsSln.Core;
using net.r_eg.MvsSln.Core.ObjHandlers;
+using Xunit;
-namespace net.r_eg.MvsSlnTest.Core.ObjHandlers
+namespace MvsSlnTest.Core.ObjHandlers
{
- [TestClass]
public class WSolutionConfigurationPlatformsTest
{
- [TestMethod]
+ [Fact]
public void ExtractTest1()
{
- var data = new List() {
+ var data = new List()
+ {
new ConfigSln("CI_Debug_net45", "Any CPU"),
new ConfigSln("CI_Debug", "Any CPU"),
new ConfigSln("CI_Release_net45", "Any CPU"),
@@ -24,7 +24,7 @@ public void ExtractTest1()
var target = (new WSolutionConfigurationPlatforms(data)).Extract(null);
- Assert.AreEqual(SlnSamplesResource.Section_Sln_Config, target);
+ Assert.Equal(SlnSamplesResource.Section_Sln_Config, target);
}
}
}
diff --git a/MvsSlnTest/Core/ObjHandlers/WVisualStudioVersionTest.cs b/MvsSlnTest/Core/ObjHandlers/WVisualStudioVersionTest.cs
index 80f01f4..d35f852 100644
--- a/MvsSlnTest/Core/ObjHandlers/WVisualStudioVersionTest.cs
+++ b/MvsSlnTest/Core/ObjHandlers/WVisualStudioVersionTest.cs
@@ -1,13 +1,12 @@
-using Microsoft.VisualStudio.TestTools.UnitTesting;
-using net.r_eg.MvsSln.Core;
+using net.r_eg.MvsSln.Core;
using net.r_eg.MvsSln.Core.ObjHandlers;
+using Xunit;
-namespace net.r_eg.MvsSlnTest.Core.ObjHandlers
+namespace MvsSlnTest.Core.ObjHandlers
{
- [TestClass]
public class WVisualStudioVersionTest
{
- [TestMethod]
+ [Fact]
public void ExtractTest1()
{
var data = new SlnHeader();
@@ -18,7 +17,7 @@ public void ExtractTest1()
var target = (new WVisualStudioVersion(data)).Extract(null);
- Assert.AreEqual(SlnSamplesResource.Section_Header, target);
+ Assert.Equal(SlnSamplesResource.Section_Header, target);
}
}
}
diff --git a/MvsSlnTest/Core/ProjectItemTest.cs b/MvsSlnTest/Core/ProjectItemTest.cs
index a357721..3b46471 100644
--- a/MvsSlnTest/Core/ProjectItemTest.cs
+++ b/MvsSlnTest/Core/ProjectItemTest.cs
@@ -1,17 +1,16 @@
-using Microsoft.VisualStudio.TestTools.UnitTesting;
-using net.r_eg.MvsSln.Core;
+using net.r_eg.MvsSln.Core;
+using Xunit;
-namespace net.r_eg.MvsSlnTest.Core
+namespace MvsSlnTest.Core
{
- [TestClass]
public class ProjectItemTest
{
- [TestMethod]
+ [Fact]
public void CtorTest1()
{
ProjectItem p = new ProjectItem("Project1", ProjectType.Cs);
- Assert.AreEqual
+ Assert.Equal
(
new ProjectItem()
{
@@ -28,7 +27,7 @@ public void CtorTest1()
SolutionFolder f = new SolutionFolder("dir1");
p = new ProjectItem("Project1", ProjectType.Cs, f);
- Assert.AreEqual
+ Assert.Equal
(
new ProjectItem()
{
@@ -44,7 +43,7 @@ public void CtorTest1()
);
p = new ProjectItem("Project2", ProjectType.Vc, "path 1");
- Assert.AreEqual
+ Assert.Equal
(
new ProjectItem()
{
@@ -59,7 +58,7 @@ public void CtorTest1()
);
p = new ProjectItem("Project2", ProjectType.Vc, "path 1", f);
- Assert.AreEqual
+ Assert.Equal
(
new ProjectItem()
{
@@ -75,7 +74,7 @@ public void CtorTest1()
);
p = new ProjectItem("Project 3", ProjectType.Vc, "prj path", f, @"C:\path\");
- Assert.AreEqual
+ Assert.Equal
(
new ProjectItem()
{
@@ -91,12 +90,12 @@ public void CtorTest1()
);
}
- [TestMethod]
+ [Fact]
public void CtorTest2()
{
ProjectItem p = new ProjectItem("{EE7DD6B7-56F4-478D-8745-3D204D915473}", "Project1", ProjectType.Cs);
- Assert.AreEqual
+ Assert.Equal
(
new ProjectItem()
{
@@ -113,7 +112,7 @@ public void CtorTest2()
SolutionFolder f = new SolutionFolder("dir1");
p = new ProjectItem("{EE7DD6B7-56F4-478D-8745-3D204D915473}", "Project1", ProjectType.Cs, f);
- Assert.AreEqual
+ Assert.Equal
(
new ProjectItem()
{
@@ -129,7 +128,7 @@ public void CtorTest2()
);
p = new ProjectItem("{EE7DD6B7-56F4-478D-8745-3D204D915473}", "Project1", ProjectType.Cs, "path 1");
- Assert.AreEqual
+ Assert.Equal
(
new ProjectItem()
{
@@ -143,7 +142,7 @@ public void CtorTest2()
p
);
- Assert.AreNotEqual
+ Assert.NotEqual
(
new ProjectItem()
{
@@ -159,7 +158,7 @@ public void CtorTest2()
);
p = new ProjectItem("{47EF5301-84E5-4210-A145-6460A1C8627A}", "Project2", ProjectType.Cs, "path 1", f);
- Assert.AreEqual
+ Assert.Equal
(
new ProjectItem()
{
@@ -175,7 +174,7 @@ public void CtorTest2()
);
p = new ProjectItem("{47EF5301-84E5-4210-A145-6460A1C8627A}", "Project2", ProjectType.Cs, "path 2", f, @"D:\slndir");
- Assert.AreEqual
+ Assert.Equal
(
new ProjectItem()
{
@@ -191,7 +190,7 @@ public void CtorTest2()
);
}
- [TestMethod]
+ [Fact]
public void CtorTest3()
{
var p = new ProjectItem
@@ -203,14 +202,14 @@ public void CtorTest3()
new SolutionFolder("dir1")
);
- Assert.AreEqual
+ Assert.Equal
(
new ProjectItem(p),
p
);
}
- [TestMethod]
+ [Fact]
public void EqTest1()
{
var project1 = new ProjectItem()
@@ -243,11 +242,11 @@ public void EqTest1()
EpType = ProjectType.Unknown
};
- Assert.AreEqual(project1, project2SameAs1);
- Assert.AreNotEqual(project1, project3AreNotSameAs1);
+ Assert.Equal(project1, project2SameAs1);
+ Assert.NotEqual(project1, project3AreNotSameAs1);
}
- [TestMethod]
+ [Fact]
public void EqTest2()
{
SolutionFolder folder1 = new SolutionFolder
@@ -307,11 +306,11 @@ public void EqTest2()
parent = new RefType(folder2)
};
- Assert.AreEqual(project1, project2SameAs1);
- Assert.AreNotEqual(project1, project3AreNotSameAs1);
+ Assert.Equal(project1, project2SameAs1);
+ Assert.NotEqual(project1, project3AreNotSameAs1);
}
- [TestMethod]
+ [Fact]
public void ParseTest1()
{
var slnDir = "X:\\dir1\\";
@@ -320,15 +319,15 @@ public void ParseTest1()
slnDir
);
- Assert.AreEqual("{27152FD4-7B94-4AF0-A7ED-BE7E7A196D57}", target.pGuid);
- Assert.AreEqual("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}", target.pType);
- Assert.AreEqual("Conari", target.name);
- Assert.AreEqual("Conari\\Conari.csproj", target.path);
- Assert.AreEqual($"{slnDir}Conari\\Conari.csproj", target.fullPath);
- Assert.AreEqual(ProjectType.Cs, target.EpType);
+ Assert.Equal("{27152FD4-7B94-4AF0-A7ED-BE7E7A196D57}", target.pGuid);
+ Assert.Equal("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}", target.pType);
+ Assert.Equal("Conari", target.name);
+ Assert.Equal("Conari\\Conari.csproj", target.path);
+ Assert.Equal($"{slnDir}Conari\\Conari.csproj", target.fullPath);
+ Assert.Equal(ProjectType.Cs, target.EpType);
}
- [TestMethod]
+ [Fact]
public void ParseTest2()
{
var slnDir = "X:\\dir1\\";
@@ -337,31 +336,31 @@ public void ParseTest2()
slnDir
);
- Assert.AreEqual(null, target.pGuid);
- Assert.AreEqual(null, target.pType);
- Assert.AreEqual(null, target.name);
- Assert.AreEqual(null, target.path);
- Assert.AreEqual(null, target.fullPath);
- Assert.AreEqual(ProjectType.Unknown, target.EpType);
+ Assert.Null(target.pGuid);
+ Assert.Null(target.pType);
+ Assert.Null(target.name);
+ Assert.Null(target.path);
+ Assert.Null(target.fullPath);
+ Assert.Equal(ProjectType.Unknown, target.EpType);
}
- [TestMethod]
+ [Fact]
public void ParseTest3()
{
var target1 = new ProjectItem(null, "X:\\dir1\\");
- Assert.AreEqual(null, target1.pGuid);
- Assert.AreEqual(null, target1.fullPath);
+ Assert.Null(target1.pGuid);
+ Assert.Null(target1.fullPath);
var target2 = new ProjectItem(
"Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"Conari\", \"Conari\\Conari.csproj\", \"{27152FD4-7B94-4AF0-A7ED-BE7E7A196D57}\"",
null
);
- Assert.AreEqual("{27152FD4-7B94-4AF0-A7ED-BE7E7A196D57}", target2.pGuid);
- Assert.AreEqual("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}", target2.pType);
- Assert.AreEqual("Conari", target2.name);
- Assert.AreEqual("Conari\\Conari.csproj", target2.path);
- Assert.AreEqual(ProjectType.Vc, target2.EpType);
+ Assert.Equal("{27152FD4-7B94-4AF0-A7ED-BE7E7A196D57}", target2.pGuid);
+ Assert.Equal("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}", target2.pType);
+ Assert.Equal("Conari", target2.name);
+ Assert.Equal("Conari\\Conari.csproj", target2.path);
+ Assert.Equal(ProjectType.Vc, target2.EpType);
}
}
}
diff --git a/MvsSlnTest/Core/SlnHandlers/LProjectDependenciesTest.cs b/MvsSlnTest/Core/SlnHandlers/LProjectDependenciesTest.cs
index 66ed08a..5254061 100644
--- a/MvsSlnTest/Core/SlnHandlers/LProjectDependenciesTest.cs
+++ b/MvsSlnTest/Core/SlnHandlers/LProjectDependenciesTest.cs
@@ -1,11 +1,10 @@
-using Microsoft.VisualStudio.TestTools.UnitTesting;
-using net.r_eg.MvsSln;
+using net.r_eg.MvsSln;
using net.r_eg.MvsSln.Core;
using net.r_eg.MvsSln.Core.SlnHandlers;
+using Xunit;
-namespace net.r_eg.MvsSlnTest.Core.SlnHandlers
+namespace MvsSlnTest.Core.SlnHandlers
{
- [TestClass]
public class LProjectDependenciesTest
{
private const string EXIST_GUID = "{11111111-1111-1111-1111-111111111111}";
@@ -13,65 +12,65 @@ public class LProjectDependenciesTest
private const string EXIST_GUID3 = "{77777777-7777-7777-7777-777777777777}";
private const string NOTEXIST_GUID = "{00000000-0000-0000-0000-000000000000}";
- [TestMethod]
+ [Fact]
public void DataTest1()
{
var target = new SProjectsMap();
- Assert.AreEqual(EXIST_GUID, target.GuidList[0]);
- Assert.AreEqual(EXIST_GUID2, target.GuidList[1]);
- Assert.AreEqual(EXIST_GUID3, target.GuidList[2]);
+ Assert.Equal(EXIST_GUID, target.GuidList[0]);
+ Assert.Equal(EXIST_GUID2, target.GuidList[1]);
+ Assert.Equal(EXIST_GUID3, target.GuidList[2]);
- Assert.AreEqual("Project1", target.FirstProject.name);
- Assert.AreEqual("path\\to.sln", target.FirstProject.path);
- Assert.AreEqual(EXIST_GUID, target.FirstProject.pGuid);
- Assert.AreEqual("{22222222-2222-2222-2222-222222222222}", target.FirstProject.pType);
+ Assert.Equal("Project1", target.FirstProject.name);
+ Assert.Equal("path\\to.sln", target.FirstProject.path);
+ Assert.Equal(EXIST_GUID, target.FirstProject.pGuid);
+ Assert.Equal("{22222222-2222-2222-2222-222222222222}", target.FirstProject.pType);
- Assert.AreEqual("Project3", target.LastProject.name);
- Assert.AreEqual("path\\to3.sln", target.LastProject.path);
- Assert.AreEqual(EXIST_GUID3, target.LastProject.pGuid);
- Assert.AreEqual("{55555555-5555-5555-5555-555555555555}", target.LastProject.pType);
+ Assert.Equal("Project3", target.LastProject.name);
+ Assert.Equal("path\\to3.sln", target.LastProject.path);
+ Assert.Equal(EXIST_GUID3, target.LastProject.pGuid);
+ Assert.Equal("{55555555-5555-5555-5555-555555555555}", target.LastProject.pType);
}
- [TestMethod]
+ [Fact]
public void DataTest2()
{
var target = new SProjectsMap();
- Assert.AreEqual("Project3", target.FirstBy(BuildType.Clean).name);
- Assert.AreEqual("path\\to3.sln", target.FirstBy(BuildType.Clean).path);
- Assert.AreEqual(EXIST_GUID3, target.FirstBy(BuildType.Clean).pGuid);
- Assert.AreEqual("{55555555-5555-5555-5555-555555555555}", target.FirstBy(BuildType.Clean).pType);
+ Assert.Equal("Project3", target.FirstBy(BuildType.Clean).name);
+ Assert.Equal("path\\to3.sln", target.FirstBy(BuildType.Clean).path);
+ Assert.Equal(EXIST_GUID3, target.FirstBy(BuildType.Clean).pGuid);
+ Assert.Equal("{55555555-5555-5555-5555-555555555555}", target.FirstBy(BuildType.Clean).pType);
- Assert.AreEqual("Project1", target.FirstBy(BuildType.Build).name);
- Assert.AreEqual("path\\to.sln", target.FirstBy(BuildType.Build).path);
- Assert.AreEqual(EXIST_GUID, target.FirstBy(BuildType.Build).pGuid);
- Assert.AreEqual("{22222222-2222-2222-2222-222222222222}", target.FirstBy(BuildType.Build).pType);
+ Assert.Equal("Project1", target.FirstBy(BuildType.Build).name);
+ Assert.Equal("path\\to.sln", target.FirstBy(BuildType.Build).path);
+ Assert.Equal(EXIST_GUID, target.FirstBy(BuildType.Build).pGuid);
+ Assert.Equal("{22222222-2222-2222-2222-222222222222}", target.FirstBy(BuildType.Build).pType);
}
- [TestMethod]
+ [Fact]
public void DataTest3()
{
var target = new SProjectsMap();
- Assert.AreEqual("Project1", target.LastBy(BuildType.Clean).name);
- Assert.AreEqual("path\\to.sln", target.LastBy(BuildType.Clean).path);
- Assert.AreEqual(EXIST_GUID, target.LastBy(BuildType.Clean).pGuid);
- Assert.AreEqual("{22222222-2222-2222-2222-222222222222}", target.LastBy(BuildType.Clean).pType);
+ Assert.Equal("Project1", target.LastBy(BuildType.Clean).name);
+ Assert.Equal("path\\to.sln", target.LastBy(BuildType.Clean).path);
+ Assert.Equal(EXIST_GUID, target.LastBy(BuildType.Clean).pGuid);
+ Assert.Equal("{22222222-2222-2222-2222-222222222222}", target.LastBy(BuildType.Clean).pType);
- Assert.AreEqual("Project3", target.LastBy(BuildType.Build).name);
- Assert.AreEqual("path\\to3.sln", target.LastBy(BuildType.Build).path);
- Assert.AreEqual(EXIST_GUID3, target.LastBy(BuildType.Build).pGuid);
- Assert.AreEqual("{55555555-5555-5555-5555-555555555555}", target.LastBy(BuildType.Build).pType);
+ Assert.Equal("Project3", target.LastBy(BuildType.Build).name);
+ Assert.Equal("path\\to3.sln", target.LastBy(BuildType.Build).path);
+ Assert.Equal(EXIST_GUID3, target.LastBy(BuildType.Build).pGuid);
+ Assert.Equal("{55555555-5555-5555-5555-555555555555}", target.LastBy(BuildType.Build).pType);
}
- [TestMethod]
+ [Fact]
public void GetProjectByTest1()
{
var target = new SProjectsMap();
- Assert.AreEqual(null, target.GetProjectBy(null).pGuid);
- Assert.AreEqual(null, target.GetProjectBy(string.Empty).pGuid);
- Assert.AreEqual(EXIST_GUID, target.GetProjectBy(EXIST_GUID).pGuid);
- Assert.AreEqual(EXIST_GUID2, target.GetProjectBy(EXIST_GUID2).pGuid);
+ Assert.Null(target.GetProjectBy(null).pGuid);
+ Assert.Null(target.GetProjectBy(string.Empty).pGuid);
+ Assert.Equal(EXIST_GUID, target.GetProjectBy(EXIST_GUID).pGuid);
+ Assert.Equal(EXIST_GUID2, target.GetProjectBy(EXIST_GUID2).pGuid);
}
private class SProjectsMap: LProjectDependencies
diff --git a/MvsSlnTest/Core/SlnHeaderTest.cs b/MvsSlnTest/Core/SlnHeaderTest.cs
index 3df3c38..a5a1b44 100644
--- a/MvsSlnTest/Core/SlnHeaderTest.cs
+++ b/MvsSlnTest/Core/SlnHeaderTest.cs
@@ -1,12 +1,11 @@
-using Microsoft.VisualStudio.TestTools.UnitTesting;
-using net.r_eg.MvsSln.Core;
+using net.r_eg.MvsSln.Core;
+using Xunit;
-namespace net.r_eg.MvsSlnTest.Core
+namespace MvsSlnTest.Core
{
- [TestClass]
public class SlnHeaderTest
{
- [TestMethod]
+ [Fact]
public void DataTest1()
{
var data = new SlnHeader();
@@ -15,25 +14,25 @@ public void DataTest1()
data.SetVisualStudioVersion("14.0.25420.1");
data.SetMinimumVersion("10.0.30319.1");
- Assert.AreNotEqual(null, data.FormatVersion);
- Assert.AreNotEqual(null, data.ProgramVersion);
- Assert.AreNotEqual(null, data.VisualStudioVersion);
- Assert.AreNotEqual(null, data.MinimumVisualStudioVersion);
+ Assert.NotNull(data.FormatVersion);
+ Assert.NotNull(data.ProgramVersion);
+ Assert.NotNull(data.VisualStudioVersion);
+ Assert.NotNull(data.MinimumVisualStudioVersion);
- Assert.AreEqual(11, data.FormatVersion.Major);
- Assert.AreEqual(0, data.FormatVersion.Minor);
+ Assert.Equal(11, data.FormatVersion.Major);
+ Assert.Equal(0, data.FormatVersion.Minor);
- Assert.AreEqual("2010", data.ProgramVersion);
+ Assert.Equal("2010", data.ProgramVersion);
- Assert.AreEqual(14, data.VisualStudioVersion.Major);
- Assert.AreEqual(0, data.VisualStudioVersion.Minor);
- Assert.AreEqual(25420, data.VisualStudioVersion.Build);
- Assert.AreEqual(1, data.VisualStudioVersion.Revision);
+ Assert.Equal(14, data.VisualStudioVersion.Major);
+ Assert.Equal(0, data.VisualStudioVersion.Minor);
+ Assert.Equal(25420, data.VisualStudioVersion.Build);
+ Assert.Equal(1, data.VisualStudioVersion.Revision);
- Assert.AreEqual(10, data.MinimumVisualStudioVersion.Major);
- Assert.AreEqual(0, data.MinimumVisualStudioVersion.Minor);
- Assert.AreEqual(30319, data.MinimumVisualStudioVersion.Build);
- Assert.AreEqual(1, data.MinimumVisualStudioVersion.Revision);
+ Assert.Equal(10, data.MinimumVisualStudioVersion.Major);
+ Assert.Equal(0, data.MinimumVisualStudioVersion.Minor);
+ Assert.Equal(30319, data.MinimumVisualStudioVersion.Build);
+ Assert.Equal(1, data.MinimumVisualStudioVersion.Revision);
}
}
}
diff --git a/MvsSlnTest/Core/SlnWriterTest.cs b/MvsSlnTest/Core/SlnWriterTest.cs
index 33401dc..f6aabb9 100644
--- a/MvsSlnTest/Core/SlnWriterTest.cs
+++ b/MvsSlnTest/Core/SlnWriterTest.cs
@@ -2,16 +2,15 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
-using Microsoft.VisualStudio.TestTools.UnitTesting;
using net.r_eg.MvsSln;
using net.r_eg.MvsSln.Core;
using net.r_eg.MvsSln.Core.ObjHandlers;
using net.r_eg.MvsSln.Core.SlnHandlers;
using net.r_eg.MvsSln.Exceptions;
+using Xunit;
-namespace net.r_eg.MvsSlnTest.Core
+namespace MvsSlnTest.Core
{
- [TestClass]
public class SlnWriterTest
{
private SlnItems defaultSlnItems = SlnItems.Projects
@@ -20,8 +19,7 @@ public class SlnWriterTest
| SlnItems.ProjectDependencies
| SlnItems.Map;
- [TestMethod]
- [ExpectedException(typeof(CoHandlerRuleException))]
+ [Fact]
public void ValidationTest1()
{
using(var sln = new Sln(defaultSlnItems, SlnSamplesResource.vsSolutionBuildEvent))
@@ -32,14 +30,15 @@ public void ValidationTest1()
[typeof(LProjectConfigurationPlatforms)] = new HandlerValue(),
};
- using(var stream = new StreamWriter(new MemoryStream())) {
- (new SlnWriter(stream, handlers)).Write(sln.Result.Map);
+ using(var stream = new StreamWriter(new MemoryStream()))
+ {
+ var writer = new SlnWriter(stream, handlers);
+ Assert.Throws(() => writer.Write(sln.Result.Map));
}
}
}
- [TestMethod]
- [ExpectedException(typeof(CoHandlerRuleException))]
+ [Fact]
public void ValidationTest2()
{
using(var sln = new Sln(defaultSlnItems, SlnSamplesResource.vsSolutionBuildEvent))
@@ -48,13 +47,15 @@ public void ValidationTest2()
[typeof(LProjectDependencies)] = new HandlerValue(),
};
- using(var stream = new StreamWriter(new MemoryStream())) {
- (new SlnWriter(stream, handlers)).Write(sln.Result.Map);
+ using(var stream = new StreamWriter(new MemoryStream()))
+ {
+ var writer = new SlnWriter(stream, handlers);
+ Assert.Throws(() => writer.Write(sln.Result.Map));
}
}
}
- [TestMethod]
+ [Fact]
public void MapRefTest1()
{
using(var sln = new Sln(defaultSlnItems, SlnSamplesResource.vsSolutionBuildEvent))
@@ -71,7 +72,7 @@ public void MapRefTest1()
using(var stream = new StreamWriter(new MemoryStream()))
{
(new SlnWriter(stream, handlers)).Write(sln.Result.Map);
- Assert.AreEqual(expectedCount, sln.Result.Map.Count);
+ Assert.Equal(expectedCount, sln.Result.Map.Count);
}
}
}
diff --git a/MvsSlnTest/Core/SolutionFolderTest.cs b/MvsSlnTest/Core/SolutionFolderTest.cs
index 218c485..61a64da 100644
--- a/MvsSlnTest/Core/SolutionFolderTest.cs
+++ b/MvsSlnTest/Core/SolutionFolderTest.cs
@@ -1,23 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using Microsoft.VisualStudio.TestTools.UnitTesting;
using net.r_eg.MvsSln.Core;
-using net.r_eg.MvsSln.Extensions;
+using Xunit;
-namespace net.r_eg.MvsSlnTest.Core
+namespace MvsSlnTest.Core
{
- [TestClass]
public class SolutionFolderTest
{
- [TestMethod]
+ [Fact]
public void SubFolderTest1()
{
var f0 = new SolutionFolder("dir3", "hMSBuild.bat");
var f1 = new SolutionFolder("dir2", f0);
var f2 = new SolutionFolder("dir1", f1);
- Assert.AreEqual
+ Assert.Equal
(
new SolutionFolder()
{
@@ -64,11 +62,11 @@ public void SubFolderTest1()
);
}
- [TestMethod]
+ [Fact]
public void CtorTest1()
{
var f = new SolutionFolder("MyFolder1", ".gnt\\gnt.core", ".gnt\\packages.config");
- Assert.AreEqual
+ Assert.Equal
(
new SolutionFolder()
{
@@ -89,13 +87,13 @@ public void CtorTest1()
},
f
);
- Assert.AreEqual(2, f.items.Count());
- Assert.AreEqual((RawText)".gnt\\gnt.core", f.items.ElementAt(0));
- Assert.AreEqual((RawText)".gnt\\packages.config", f.items.ElementAt(1));
+ Assert.Equal(2, f.items.Count());
+ Assert.Equal((RawText)".gnt\\gnt.core", f.items.ElementAt(0));
+ Assert.Equal((RawText)".gnt\\packages.config", f.items.ElementAt(1));
f = new SolutionFolder("MyFolder1", ".gnt\\gnt.core");
- Assert.AreEqual
+ Assert.Equal
(
new SolutionFolder()
{
@@ -116,12 +114,12 @@ public void CtorTest1()
},
f
);
- Assert.AreEqual(1, f.items.Count());
- Assert.AreEqual((RawText)".gnt\\gnt.core", f.items.ElementAt(0));
+ Assert.Single(f.items);
+ Assert.Equal((RawText)".gnt\\gnt.core", f.items.ElementAt(0));
f = new SolutionFolder("MyFolder1");
- Assert.AreEqual
+ Assert.Equal
(
new SolutionFolder()
{
@@ -138,15 +136,15 @@ public void CtorTest1()
},
f
);
- Assert.AreEqual(0, f.items.Count());
+ Assert.Empty(f.items);
}
- [TestMethod]
+ [Fact]
public void CtorTest2()
{
var f = new SolutionFolder("MyFolder4", (new RawText[] { ".gnt\\gnt.core" }).AsEnumerable());
- Assert.AreEqual
+ Assert.Equal
(
new SolutionFolder()
{
@@ -168,11 +166,11 @@ public void CtorTest2()
f
);
- Assert.AreEqual(1, f.items.Count());
- Assert.AreEqual((RawText)".gnt\\gnt.core", f.items.ElementAt(0));
+ Assert.Single(f.items);
+ Assert.Equal((RawText)".gnt\\gnt.core", f.items.ElementAt(0));
}
- [TestMethod]
+ [Fact]
public void CtorTest3()
{
var f = new SolutionFolder
@@ -184,20 +182,20 @@ public void CtorTest3()
".gnt\\packages.config"
);
- Assert.AreEqual
+ Assert.Equal
(
new SolutionFolder(f),
f
);
}
- [TestMethod]
+ [Fact]
public void CtorTest4()
{
var f0 = new SolutionFolder("dir1");
var f = new SolutionFolder("MyFolder1", f0, ".gnt\\gnt.core", ".gnt\\packages.config");
- Assert.AreEqual
+ Assert.Equal
(
new SolutionFolder()
{
@@ -219,13 +217,13 @@ public void CtorTest4()
},
f
);
- Assert.AreEqual(2, f.items.Count());
- Assert.AreEqual((RawText)".gnt\\gnt.core", f.items.ElementAt(0));
- Assert.AreEqual((RawText)".gnt\\packages.config", f.items.ElementAt(1));
+ Assert.Equal(2, f.items.Count());
+ Assert.Equal((RawText)".gnt\\gnt.core", f.items.ElementAt(0));
+ Assert.Equal((RawText)".gnt\\packages.config", f.items.ElementAt(1));
f = new SolutionFolder("MyFolder2", f0, ".gnt\\gnt.core");
- Assert.AreEqual
+ Assert.Equal
(
new SolutionFolder()
{
@@ -247,12 +245,12 @@ public void CtorTest4()
},
f
);
- Assert.AreEqual(1, f.items.Count());
- Assert.AreEqual((RawText)".gnt\\gnt.core", f.items.ElementAt(0));
+ Assert.Single(f.items);
+ Assert.Equal((RawText)".gnt\\gnt.core", f.items.ElementAt(0));
f = new SolutionFolder("MyFolder3", f0);
- Assert.AreEqual
+ Assert.Equal
(
new SolutionFolder()
{
@@ -270,11 +268,11 @@ public void CtorTest4()
},
f
);
- Assert.AreEqual(0, f.items.Count());
+ Assert.Empty(f.items);
f = new SolutionFolder("MyFolder4", f0, (new RawText[] { ".gnt\\gnt.core" }).AsEnumerable());
- Assert.AreEqual
+ Assert.Equal
(
new SolutionFolder()
{
@@ -296,18 +294,18 @@ public void CtorTest4()
},
f
);
- Assert.AreEqual(1, f.items.Count());
- Assert.AreEqual((RawText)".gnt\\gnt.core", f.items.ElementAt(0));
+ Assert.Single(f.items);
+ Assert.Equal((RawText)".gnt\\gnt.core", f.items.ElementAt(0));
}
- [TestMethod]
+ [Fact]
public void CtorTest5()
{
var f = new SolutionFolder(
"{EE7DD6B7-56F4-478D-8745-3D204D915473}", "MyFolder1",
new RawText[] { ".gnt\\gnt.core", ".gnt\\packages.config" }
);
- Assert.AreEqual
+ Assert.Equal
(
new SolutionFolder()
{
@@ -328,9 +326,9 @@ public void CtorTest5()
},
f
);
- Assert.AreEqual(2, f.items.Count());
- Assert.AreEqual((RawText)".gnt\\gnt.core", f.items.ElementAt(0));
- Assert.AreEqual((RawText)".gnt\\packages.config", f.items.ElementAt(1));
+ Assert.Equal(2, f.items.Count());
+ Assert.Equal((RawText)".gnt\\gnt.core", f.items.ElementAt(0));
+ Assert.Equal((RawText)".gnt\\packages.config", f.items.ElementAt(1));
var f0 = new SolutionFolder();
@@ -342,7 +340,7 @@ public void CtorTest5()
f0,
".gnt\\gnt.core", ".gnt\\packages.config"
);
- Assert.AreEqual
+ Assert.Equal
(
new SolutionFolder()
{
@@ -364,12 +362,12 @@ public void CtorTest5()
},
f
);
- Assert.AreEqual(2, f.items.Count());
- Assert.AreEqual((RawText)".gnt\\gnt.core", f.items.ElementAt(0));
- Assert.AreEqual((RawText)".gnt\\packages.config", f.items.ElementAt(1));
+ Assert.Equal(2, f.items.Count());
+ Assert.Equal((RawText)".gnt\\gnt.core", f.items.ElementAt(0));
+ Assert.Equal((RawText)".gnt\\packages.config", f.items.ElementAt(1));
}
- [TestMethod]
+ [Fact]
public void CtorTest6()
{
var f = new SolutionFolder
@@ -377,7 +375,7 @@ public void CtorTest6()
"{EE7DD6B7-56F4-478D-8745-3D204D915473}", "MyFolder1",
new RawText[] { ".gnt\\gnt.core" }
);
- Assert.AreEqual
+ Assert.Equal
(
new SolutionFolder()
{
@@ -398,12 +396,12 @@ public void CtorTest6()
},
f
);
- Assert.AreEqual(1, f.items.Count());
- Assert.AreEqual((RawText)".gnt\\gnt.core", f.items.ElementAt(0));
+ Assert.Single(f.items);
+ Assert.Equal((RawText)".gnt\\gnt.core", f.items.ElementAt(0));
f = new SolutionFolder("{EE7DD6B7-56F4-478D-8745-3D204D915473}", "MyFolder1", new RawText[] { });
- Assert.AreEqual
+ Assert.Equal
(
new SolutionFolder()
{
@@ -420,7 +418,7 @@ public void CtorTest6()
},
f
);
- Assert.AreEqual(0, f.items.Count());
+ Assert.Empty(f.items);
f = new SolutionFolder
@@ -428,7 +426,7 @@ public void CtorTest6()
"{EE7DD6B7-56F4-478D-8745-3D204D915473}", "MyFolder1",
(new RawText[] { ".gnt\\gnt.core" }).AsEnumerable()
);
- Assert.AreEqual
+ Assert.Equal
(
new SolutionFolder()
{
@@ -449,11 +447,11 @@ public void CtorTest6()
},
f
);
- Assert.AreEqual(1, f.items.Count());
- Assert.AreEqual((RawText)".gnt\\gnt.core", f.items.ElementAt(0));
+ Assert.Single(f.items);
+ Assert.Equal((RawText)".gnt\\gnt.core", f.items.ElementAt(0));
}
- [TestMethod]
+ [Fact]
public void CtorTest7()
{
var f0 = new SolutionFolder("dir1");
@@ -463,7 +461,7 @@ public void CtorTest7()
"{EE7DD6B7-56F4-478D-8745-3D204D915473}", "MyFolder4", f0,
(new RawText[] { ".gnt\\gnt.core" }).AsEnumerable()
);
- Assert.AreEqual
+ Assert.Equal
(
new SolutionFolder()
{
@@ -485,8 +483,8 @@ public void CtorTest7()
},
f
);
- Assert.AreEqual(1, f.items.Count());
- Assert.AreEqual((RawText)".gnt\\gnt.core", f.items.ElementAt(0));
+ Assert.Single(f.items);
+ Assert.Equal((RawText)".gnt\\gnt.core", f.items.ElementAt(0));
f = new SolutionFolder
@@ -494,7 +492,7 @@ public void CtorTest7()
"{EE7DD6B7-56F4-478D-8745-3D204D915473}", "MyFolder1", f0,
".gnt\\gnt.core", ".gnt\\packages.config"
);
- Assert.AreEqual
+ Assert.Equal
(
new SolutionFolder()
{
@@ -516,13 +514,13 @@ public void CtorTest7()
},
f
);
- Assert.AreEqual(2, f.items.Count());
- Assert.AreEqual((RawText)".gnt\\gnt.core", f.items.ElementAt(0));
- Assert.AreEqual((RawText)".gnt\\packages.config", f.items.ElementAt(1));
+ Assert.Equal(2, f.items.Count());
+ Assert.Equal((RawText)".gnt\\gnt.core", f.items.ElementAt(0));
+ Assert.Equal((RawText)".gnt\\packages.config", f.items.ElementAt(1));
f = new SolutionFolder("{EE7DD6B7-56F4-478D-8745-3D204D915473}", "MyFolder2", f0, ".gnt\\gnt.core");
- Assert.AreEqual
+ Assert.Equal
(
new SolutionFolder()
{
@@ -544,12 +542,12 @@ public void CtorTest7()
},
f
);
- Assert.AreEqual(1, f.items.Count());
- Assert.AreEqual((RawText)".gnt\\gnt.core", f.items.ElementAt(0));
+ Assert.Single(f.items);
+ Assert.Equal((RawText)".gnt\\gnt.core", f.items.ElementAt(0));
f = new SolutionFolder("{5D5C7878-22BE-4E5B-BD96-6CBBAC614AD3}", "MyFolder3", f0);
- Assert.AreEqual
+ Assert.Equal
(
new SolutionFolder()
{
@@ -567,16 +565,16 @@ public void CtorTest7()
},
f
);
- Assert.AreEqual(0, f.items.Count());
+ Assert.Empty(f.items);
}
- [TestMethod]
+ [Fact]
public void CtorTest8()
{
Guid guid = new Guid("{8B05CE1C-999E-460D-80FF-E44DFEC019E7}");
var f = new SolutionFolder(guid, "dir1");
- Assert.AreEqual
+ Assert.Equal
(
new SolutionFolder()
{
@@ -593,11 +591,11 @@ public void CtorTest8()
},
f
);
- Assert.AreEqual(0, f.items.Count());
+ Assert.Empty(f.items);
f = new SolutionFolder("{8B05CE1C-999E-460D-80FF-E44DFEC019E7}", "dir2", null);
- Assert.AreEqual
+ Assert.Equal
(
new SolutionFolder()
{
@@ -614,7 +612,7 @@ public void CtorTest8()
},
f
);
- Assert.AreEqual(0, f.items.Count());
+ Assert.Empty(f.items);
}
}
}
diff --git a/MvsSlnTest/Core/SynchSubscribersTest.cs b/MvsSlnTest/Core/SynchSubscribersTest.cs
index 80d367b..791ac29 100644
--- a/MvsSlnTest/Core/SynchSubscribersTest.cs
+++ b/MvsSlnTest/Core/SynchSubscribersTest.cs
@@ -1,57 +1,56 @@
using System;
-using Microsoft.VisualStudio.TestTools.UnitTesting;
using net.r_eg.MvsSln.Core;
+using Xunit;
-namespace net.r_eg.MvsSlnTest.Core
+namespace MvsSlnTest.Core
{
- [TestClass]
public class SynchSubscribersTest
{
- [TestMethod]
+ [Fact]
public void ContainerTest1()
{
var data = new SynchSubscribers();
- Assert.AreEqual(0, data.Count);
+ Assert.Equal(0, data.Count);
var listener1 = new Listener1();
var listener2 = new Listener2();
data.Register(listener1);
data.Register(listener2);
- Assert.AreEqual(2, data.Count);
+ Assert.Equal(2, data.Count);
data.Unregister(listener1);
- Assert.AreEqual(1, data.Count);
+ Assert.Equal(1, data.Count);
// existence
- Assert.AreEqual(true, data.Contains(listener2));
- Assert.AreEqual(false, data.Contains(listener1));
+ Assert.True(data.Contains(listener2));
+ Assert.False(data.Contains(listener1));
- Assert.AreEqual(true, data.Exists(listener2.Id));
- Assert.AreEqual(false, data.Exists(listener1.Id));
+ Assert.True(data.Exists(listener2.Id));
+ Assert.False(data.Exists(listener1.Id));
// re-adding + duplicates
data.Register(listener1);
data.Register(listener1);
- Assert.AreEqual(2, data.Count);
- Assert.AreEqual(true, data.Contains(listener1));
- Assert.AreEqual(true, data.Exists(listener1.Id));
+ Assert.Equal(2, data.Count);
+ Assert.True(data.Contains(listener1));
+ Assert.True(data.Exists(listener1.Id));
// access by id
- Assert.AreEqual(listener1.Id, data.GetById(listener1.Id).Id);
- Assert.AreEqual(listener2.Id, data.GetById(listener2.Id).Id);
+ Assert.Equal(listener1.Id, data.GetById(listener1.Id).Id);
+ Assert.Equal(listener2.Id, data.GetById(listener2.Id).Id);
var nonexistent = "{8A805C3B-9941-4B82-94D0-E641EBA3881B}";
- Assert.AreEqual(null, data.GetById(new Guid(nonexistent)));
+ Assert.Null(data.GetById(new Guid(nonexistent)));
data.Reset();
- Assert.AreEqual(0, data.Count);
+ Assert.Equal(0, data.Count);
}
- [TestMethod]
+ [Fact]
public void ContainerTest2()
{
var data = new SynchSubscribers();
@@ -64,23 +63,23 @@ public void ContainerTest2()
var enumerator = data.GetEnumerator();
- Assert.AreEqual(true, enumerator.MoveNext());
- Assert.AreEqual(listener1.Id, enumerator.Current.Id);
- Assert.AreEqual(true, enumerator.MoveNext());
- Assert.AreEqual(listener2.Id, enumerator.Current.Id);
+ Assert.True(enumerator.MoveNext());
+ Assert.Equal(listener1.Id, enumerator.Current.Id);
+ Assert.True(enumerator.MoveNext());
+ Assert.Equal(listener2.Id, enumerator.Current.Id);
data.Unregister(listener1);
data.Register(listener1);
enumerator = data.GetEnumerator();
- Assert.AreEqual(true, enumerator.MoveNext());
- Assert.AreEqual(listener2.Id, enumerator.Current.Id);
- Assert.AreEqual(true, enumerator.MoveNext());
- Assert.AreEqual(listener1.Id, enumerator.Current.Id);
+ Assert.True(enumerator.MoveNext());
+ Assert.Equal(listener2.Id, enumerator.Current.Id);
+ Assert.True(enumerator.MoveNext());
+ Assert.Equal(listener1.Id, enumerator.Current.Id);
}
- [TestMethod]
+ [Fact]
public void ContainerTest3()
{
var data = new SynchSubscribers();
@@ -91,8 +90,8 @@ public void ContainerTest3()
data.Register(listener1);
data.Register(listener2);
- Assert.AreEqual(listener1.Id, data[0].Id);
- Assert.AreEqual(listener2.Id, data[listener2.Id].Id);
+ Assert.Equal(listener1.Id, data[0].Id);
+ Assert.Equal(listener2.Id, data[listener2.Id].Id);
}
private class Listener1: IHandler
diff --git a/MvsSlnTest/Core/XProjectTest.cs b/MvsSlnTest/Core/XProjectTest.cs
index 65e6d91..8381f61 100644
--- a/MvsSlnTest/Core/XProjectTest.cs
+++ b/MvsSlnTest/Core/XProjectTest.cs
@@ -1,15 +1,14 @@
using System.Collections.Generic;
using System.Linq;
-using Microsoft.VisualStudio.TestTools.UnitTesting;
using net.r_eg.MvsSln;
using net.r_eg.MvsSln.Core;
+using Xunit;
-namespace net.r_eg.MvsSlnTest.Core
+namespace MvsSlnTest.Core
{
- [TestClass]
public class XProjectTest
{
- [TestMethod]
+ [Fact]
public void PropertiesTest1()
{
var projects = new Dictionary() {
@@ -20,17 +19,17 @@ public void PropertiesTest1()
{
IXProject project = sln.Result.Env.Projects.FirstOrDefault();
- Assert.AreEqual(null, project.GetProperty("NOT_REAL_PROPERTY").name);
- Assert.AreEqual("MyProperty1", project.SetProperty("MyProperty1", "Value1").name);
- Assert.AreEqual("Value1", project.GetProperty("MyProperty1").evaluatedValue);
+ Assert.Null(project.GetProperty("NOT_REAL_PROPERTY").name);
+ Assert.Equal("MyProperty1", project.SetProperty("MyProperty1", "Value1").name);
+ Assert.Equal("Value1", project.GetProperty("MyProperty1").evaluatedValue);
- Assert.AreEqual(false, project.RemoveProperty("NOT_REAL_PROPERTY_2"));
- Assert.AreEqual(true, project.RemoveProperty("MyProperty1"));
- Assert.AreEqual(null, project.GetProperty("MyProperty1").name);
+ Assert.False(project.RemoveProperty("NOT_REAL_PROPERTY_2"));
+ Assert.True(project.RemoveProperty("MyProperty1"));
+ Assert.Null(project.GetProperty("MyProperty1").name);
}
}
- [TestMethod]
+ [Fact]
public void ItemsTest1()
{
var projects = new Dictionary() {
@@ -41,13 +40,13 @@ public void ItemsTest1()
{
IXProject project = sln.Result.Env.Projects.FirstOrDefault();
- Assert.AreEqual(null, project.GetItem("Reference", "NOT_REAL_INC").evaluatedInclude);
- Assert.AreEqual(true, project.AddItem("Reference", "MyInclude"));
- Assert.AreEqual("MyInclude", project.GetItem("Reference", "MyInclude").evaluatedInclude);
+ Assert.Null(project.GetItem("Reference", "NOT_REAL_INC").evaluatedInclude);
+ Assert.True(project.AddItem("Reference", "MyInclude"));
+ Assert.Equal("MyInclude", project.GetItem("Reference", "MyInclude").evaluatedInclude);
- Assert.AreEqual(false, project.RemoveItem("Reference", "NOT_REAL_INC"));
- Assert.AreEqual(true, project.RemoveItem("Reference", "MyInclude"));
- Assert.AreEqual(null, project.GetItem("Reference", "MyInclude").evaluatedInclude);
+ Assert.False(project.RemoveItem("Reference", "NOT_REAL_INC"));
+ Assert.True(project.RemoveItem("Reference", "MyInclude"));
+ Assert.Null(project.GetItem("Reference", "MyInclude").evaluatedInclude);
}
}
}
diff --git a/MvsSlnTest/Extensions/StringExtensionTest.cs b/MvsSlnTest/Extensions/StringExtensionTest.cs
index 503c897..06254e7 100644
--- a/MvsSlnTest/Extensions/StringExtensionTest.cs
+++ b/MvsSlnTest/Extensions/StringExtensionTest.cs
@@ -1,168 +1,167 @@
using System;
using System.IO;
-using Microsoft.VisualStudio.TestTools.UnitTesting;
using net.r_eg.MvsSln.Extensions;
+using Xunit;
-namespace net.r_eg.MvsSlnTest.Extensions
+namespace MvsSlnTest.Extensions
{
- [TestClass]
public class StringExtensionTest
{
- [TestMethod]
+ [Fact]
public void GuidTest1()
{
string data = " MvsSln_-_v1 ";
- Assert.AreEqual(new Guid("{ee265a58-1e72-6c44-60aa-134eaf5c6f9c}"), data.Guid());
- Assert.AreEqual(new Guid("{d98c1dd4-008f-04b2-e980-0998ecf8427e}"), "".Guid());
- Assert.AreEqual(new Guid("{ef8db523-b411-2757-d335-1702515f86af}"), " ".Guid());
- Assert.AreEqual(new Guid("{d98c1dd4-008f-04b2-e980-0998ecf8427e}"), ((string)null).Guid());
+ Assert.Equal(new Guid("{ee265a58-1e72-6c44-60aa-134eaf5c6f9c}"), data.Guid());
+ Assert.Equal(new Guid("{d98c1dd4-008f-04b2-e980-0998ecf8427e}"), "".Guid());
+ Assert.Equal(new Guid("{ef8db523-b411-2757-d335-1702515f86af}"), " ".Guid());
+ Assert.Equal(new Guid("{d98c1dd4-008f-04b2-e980-0998ecf8427e}"), ((string)null).Guid());
}
- [TestMethod]
+ [Fact]
public void GuidSlnFormatTest1()
{
- Assert.AreEqual
+ Assert.Equal
(
"{D98C1DD4-008F-04B2-E980-0998ECF8427E}",
new Guid("{d98c1dd4-008f-04b2-e980-0998ecf8427e}").SlnFormat()
);
}
- [TestMethod]
+ [Fact]
public void ReformatSlnGuidTest1()
{
- Assert.AreEqual("{D98C1DD4-008F-04B2-E980-0998ECF8427E}", "".ReformatSlnGuid());
- Assert.AreEqual("{D98C1DD4-008F-04B2-E980-0998ECF8427E}", " ".ReformatSlnGuid());
- Assert.AreEqual(null, ((string)null).ReformatSlnGuid());
- Assert.AreEqual("{842DDBFE-FECA-8620-2CB4-399751A8A7E3}", "invalid".ReformatSlnGuid());
- Assert.AreEqual("{DCE5BB88-7640-4CFB-861D-6CBAA1F6EF0E}", "dce5bb88-7640-4cfb-861d-6cbaa1f6ef0e".ReformatSlnGuid());
- Assert.AreEqual("{D98C1DD4-008F-04B2-E980-0998ECF8427E}", "{d98c1dd4-008f-04b2-e980-0998ecf8427e}".ReformatSlnGuid());
+ Assert.Equal("{D98C1DD4-008F-04B2-E980-0998ECF8427E}", "".ReformatSlnGuid());
+ Assert.Equal("{D98C1DD4-008F-04B2-E980-0998ECF8427E}", " ".ReformatSlnGuid());
+ Assert.Null(((string)null).ReformatSlnGuid());
+ Assert.Equal("{842DDBFE-FECA-8620-2CB4-399751A8A7E3}", "invalid".ReformatSlnGuid());
+ Assert.Equal("{DCE5BB88-7640-4CFB-861D-6CBAA1F6EF0E}", "dce5bb88-7640-4cfb-861d-6cbaa1f6ef0e".ReformatSlnGuid());
+ Assert.Equal("{D98C1DD4-008F-04B2-E980-0998ECF8427E}", "{d98c1dd4-008f-04b2-e980-0998ecf8427e}".ReformatSlnGuid());
}
- [TestMethod]
+ [Fact]
public void DirectoryPathFormatTest1()
{
string dir1 = @"D:\path\to\dir1";
- Assert.AreEqual($"{dir1}{Path.DirectorySeparatorChar}", dir1.DirectoryPathFormat());
+ Assert.Equal($"{dir1}{Path.DirectorySeparatorChar}", dir1.DirectoryPathFormat());
string dir2 = @"D:\path\to\dir2\";
- Assert.AreEqual(dir2, dir2.DirectoryPathFormat());
+ Assert.Equal(dir2, dir2.DirectoryPathFormat());
string dir3 = null;
- Assert.AreEqual(Path.DirectorySeparatorChar.ToString(), dir3.DirectoryPathFormat());
- Assert.AreEqual(Path.DirectorySeparatorChar.ToString(), "".DirectoryPathFormat());
+ Assert.Equal(Path.DirectorySeparatorChar.ToString(), dir3.DirectoryPathFormat());
+ Assert.Equal(Path.DirectorySeparatorChar.ToString(), "".DirectoryPathFormat());
}
- [TestMethod]
+ [Fact]
public void IsDirectoryPathTest1()
{
string dir1 = @"D:\path\to\dir1";
- Assert.AreEqual(false, dir1.IsDirectoryPath());
+ Assert.False(dir1.IsDirectoryPath());
string dir2 = @"D:\path\to\dir2\";
- Assert.AreEqual(true, dir2.IsDirectoryPath());
+ Assert.True(dir2.IsDirectoryPath());
string dir3 = null;
- Assert.AreEqual(false, dir3.IsDirectoryPath());
- Assert.AreEqual(false, "".IsDirectoryPath());
+ Assert.False(dir3.IsDirectoryPath());
+ Assert.False("".IsDirectoryPath());
}
- [TestMethod]
+ [Fact]
public void MakeRelativePathTest1()
{
string dir0 = @"D:\path\to\dir0";
string dir1 = null;
- Assert.AreEqual(null, dir1.MakeRelativePath(dir0));
- Assert.AreEqual(null, dir1.MakeRelativePath(String.Empty));
- Assert.AreEqual(null, dir1.MakeRelativePath(null));
+ Assert.Null(dir1.MakeRelativePath(dir0));
+ Assert.Null(dir1.MakeRelativePath(String.Empty));
+ Assert.Null(dir1.MakeRelativePath(null));
- Assert.AreEqual(null, "".MakeRelativePath(dir0));
- Assert.AreEqual(null, "".MakeRelativePath(String.Empty));
- Assert.AreEqual(null, "".MakeRelativePath(null));
+ Assert.Null("".MakeRelativePath(dir0));
+ Assert.Null("".MakeRelativePath(String.Empty));
+ Assert.Null("".MakeRelativePath(null));
- Assert.AreEqual(null, dir0.MakeRelativePath(String.Empty));
- Assert.AreEqual(null, dir0.MakeRelativePath(null));
+ Assert.Null(dir0.MakeRelativePath(String.Empty));
+ Assert.Null(dir0.MakeRelativePath(null));
}
- [TestMethod]
+ [Fact]
public void MakeRelativePathTest2()
{
- Assert.AreEqual(@"bin\Release\file", @"D:\path\to\dir1".MakeRelativePath(@"D:\path\to\dir1\bin\Release\file"));
+ Assert.Equal(@"bin\Release\file", @"D:\path\to\dir1".MakeRelativePath(@"D:\path\to\dir1\bin\Release\file"));
- Assert.AreEqual(@"..\bin\Release\file", @"D:\path\to\dir1".MakeRelativePath(@"D:\path\to\bin\Release\file"));
- Assert.AreEqual(@"..\dir2\bin\Release\file", @"D:\path\to\dir1".MakeRelativePath(@"D:\path\to\dir2\bin\Release\file"));
+ Assert.Equal(@"..\bin\Release\file", @"D:\path\to\dir1".MakeRelativePath(@"D:\path\to\bin\Release\file"));
+ Assert.Equal(@"..\dir2\bin\Release\file", @"D:\path\to\dir1".MakeRelativePath(@"D:\path\to\dir2\bin\Release\file"));
- Assert.AreEqual(@"bin\Release\file", @"D:\path\to\dir1".MakeRelativePath(@"bin\Release\file"));
+ Assert.Equal(@"bin\Release\file", @"D:\path\to\dir1".MakeRelativePath(@"bin\Release\file"));
- Assert.AreEqual(null, @"path\to\dir1".MakeRelativePath(@"D:\path\to\dir1\bin\Release\file"));
+ Assert.Null(@"path\to\dir1".MakeRelativePath(@"D:\path\to\dir1\bin\Release\file"));
}
- [TestMethod]
+ [Fact]
public void FirstNonWhiteSpaceTest1()
{
- Assert.AreEqual(10, " ActiveCfg = ".FirstNonWhiteSpace(12, true));
- Assert.AreEqual(10, " ActiveCfg = ".FirstNonWhiteSpace(11, true));
+ Assert.Equal(10, " ActiveCfg = ".FirstNonWhiteSpace(12, true));
+ Assert.Equal(10, " ActiveCfg = ".FirstNonWhiteSpace(11, true));
- Assert.AreEqual(13, " ActiveCfg = ".FirstNonWhiteSpace(12, false));
- Assert.AreEqual(14, " ActiveCfg = ".FirstNonWhiteSpace(12, false));
+ Assert.Equal(13, " ActiveCfg = ".FirstNonWhiteSpace(12, false));
+ Assert.Equal(14, " ActiveCfg = ".FirstNonWhiteSpace(12, false));
- Assert.AreEqual(2, " A ctiveCfg".FirstNonWhiteSpace(0, false));
- Assert.AreEqual(4, " A ctiveCfg".FirstNonWhiteSpace(4, true));
- Assert.AreEqual(2, " A ctiveCfg".FirstNonWhiteSpace(3, true));
- Assert.AreEqual(0, "A ctiveCfg".FirstNonWhiteSpace(0, false));
+ Assert.Equal(2, " A ctiveCfg".FirstNonWhiteSpace(0, false));
+ Assert.Equal(4, " A ctiveCfg".FirstNonWhiteSpace(4, true));
+ Assert.Equal(2, " A ctiveCfg".FirstNonWhiteSpace(3, true));
+ Assert.Equal(0, "A ctiveCfg".FirstNonWhiteSpace(0, false));
}
- [TestMethod]
+ [Fact]
public void FirstNonWhiteSpaceTest2()
{
- Assert.AreEqual(-1, " ActiveCfg = ".FirstNonWhiteSpace(0, true));
- Assert.AreEqual(0, "ActiveCfg = ".FirstNonWhiteSpace(0, true));
+ Assert.Equal(-1, " ActiveCfg = ".FirstNonWhiteSpace(0, true));
+ Assert.Equal(0, "ActiveCfg = ".FirstNonWhiteSpace(0, true));
- Assert.AreEqual(-1, " ActiveCfg = ".FirstNonWhiteSpace(1, true));
- Assert.AreEqual(1, "ActiveCfg = ".FirstNonWhiteSpace(1, true));
+ Assert.Equal(-1, " ActiveCfg = ".FirstNonWhiteSpace(1, true));
+ Assert.Equal(1, "ActiveCfg = ".FirstNonWhiteSpace(1, true));
- Assert.AreEqual(-1, " ActiveCfg = ".FirstNonWhiteSpace(13, false));
- Assert.AreEqual(-1, " ActiveCfg =".FirstNonWhiteSpace(13, false));
+ Assert.Equal(-1, " ActiveCfg = ".FirstNonWhiteSpace(13, false));
+ Assert.Equal(-1, " ActiveCfg =".FirstNonWhiteSpace(13, false));
- Assert.AreEqual(12, " ActiveCfg = ".FirstNonWhiteSpace(12, false));
- Assert.AreEqual(12, " ActiveCfg =".FirstNonWhiteSpace(12, false));
+ Assert.Equal(12, " ActiveCfg = ".FirstNonWhiteSpace(12, false));
+ Assert.Equal(12, " ActiveCfg =".FirstNonWhiteSpace(12, false));
}
- [TestMethod]
+ [Fact]
public void FirstNonWhiteSpaceTest3()
{
- Assert.AreEqual(-1, "ActiveCfg".FirstNonWhiteSpace(50, false));
- Assert.AreEqual(-1, "ActiveCfg".FirstNonWhiteSpace(50, true));
+ Assert.Equal(-1, "ActiveCfg".FirstNonWhiteSpace(50, false));
+ Assert.Equal(-1, "ActiveCfg".FirstNonWhiteSpace(50, true));
- Assert.AreEqual(-1, " ActiveCfg ".FirstNonWhiteSpace(50, false));
- Assert.AreEqual(-1, " ActiveCfg ".FirstNonWhiteSpace(50, true));
+ Assert.Equal(-1, " ActiveCfg ".FirstNonWhiteSpace(50, false));
+ Assert.Equal(-1, " ActiveCfg ".FirstNonWhiteSpace(50, true));
- Assert.AreEqual(-1, "ActiveCfg".FirstNonWhiteSpace(-50, false));
- Assert.AreEqual(-1, "ActiveCfg".FirstNonWhiteSpace(-50, true));
+ Assert.Equal(-1, "ActiveCfg".FirstNonWhiteSpace(-50, false));
+ Assert.Equal(-1, "ActiveCfg".FirstNonWhiteSpace(-50, true));
- Assert.AreEqual(-1, " ActiveCfg ".FirstNonWhiteSpace(-50, false));
- Assert.AreEqual(-1, " ActiveCfg ".FirstNonWhiteSpace(-50, true));
+ Assert.Equal(-1, " ActiveCfg ".FirstNonWhiteSpace(-50, false));
+ Assert.Equal(-1, " ActiveCfg ".FirstNonWhiteSpace(-50, true));
}
- [TestMethod]
+ [Fact]
public void FirstNonWhiteSpaceTest4()
{
- Assert.AreEqual(-1, " ".FirstNonWhiteSpace(0, false));
- Assert.AreEqual(-1, " ".FirstNonWhiteSpace(0, false));
- Assert.AreEqual(-1, String.Empty.FirstNonWhiteSpace(0, false));
- Assert.AreEqual(-1, ((string)null).FirstNonWhiteSpace(0, false));
-
- Assert.AreEqual(-1, " ".FirstNonWhiteSpace(0, true));
- Assert.AreEqual(-1, " ".FirstNonWhiteSpace(0, true));
- Assert.AreEqual(-1, String.Empty.FirstNonWhiteSpace(0, true));
- Assert.AreEqual(-1, ((string)null).FirstNonWhiteSpace(0, true));
-
- Assert.AreEqual(-1, " ".FirstNonWhiteSpace(1, true));
- Assert.AreEqual(-1, " ".FirstNonWhiteSpace(1, true));
- Assert.AreEqual(-1, String.Empty.FirstNonWhiteSpace(1, true));
- Assert.AreEqual(-1, ((string)null).FirstNonWhiteSpace(1, true));
+ Assert.Equal(-1, " ".FirstNonWhiteSpace(0, false));
+ Assert.Equal(-1, " ".FirstNonWhiteSpace(0, false));
+ Assert.Equal(-1, String.Empty.FirstNonWhiteSpace(0, false));
+ Assert.Equal(-1, ((string)null).FirstNonWhiteSpace(0, false));
+
+ Assert.Equal(-1, " ".FirstNonWhiteSpace(0, true));
+ Assert.Equal(-1, " ".FirstNonWhiteSpace(0, true));
+ Assert.Equal(-1, String.Empty.FirstNonWhiteSpace(0, true));
+ Assert.Equal(-1, ((string)null).FirstNonWhiteSpace(0, true));
+
+ Assert.Equal(-1, " ".FirstNonWhiteSpace(1, true));
+ Assert.Equal(-1, " ".FirstNonWhiteSpace(1, true));
+ Assert.Equal(-1, String.Empty.FirstNonWhiteSpace(1, true));
+ Assert.Equal(-1, ((string)null).FirstNonWhiteSpace(1, true));
}
}
}
diff --git a/MvsSlnTest/MvsSlnTest.csproj b/MvsSlnTest/MvsSlnTest.csproj
index 914bf6a..b20640d 100644
--- a/MvsSlnTest/MvsSlnTest.csproj
+++ b/MvsSlnTest/MvsSlnTest.csproj
@@ -1,121 +1,47 @@
-
-
-
-
- Debug
- AnyCPU
- {EC0CA220-39EC-41E5-B9D6-88D8F860F979}
- Library
- Properties
- net.r_eg.MvsSlnTest
- MvsSlnTest
- v4.5
- 512
- {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- 15.0
- $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
- $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages
- False
- UnitTest
-
-
-
-
-
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
- false
-
-
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
- false
-
+
+
+ netcoreapp2.1
+ false
true
-
-
key.snk
+
-
- ..\packages\MSTest.TestFramework.1.4.0\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll
-
-
- ..\packages\MSTest.TestFramework.1.4.0\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll
-
-
-
+
+
+
+ all
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- True
- True
+
+
+
+
+
PrjSamplesResource.resx
-
-
-
-
- True
True
+ True
+
+
SlnSamplesResource.resx
+ True
+ True
-
-
-
-
-
-
+
-
- {f905dfb2-2e67-4ff7-9001-924f6f2d645d}
- MvsSln
-
-
-
-
- ResXFileCodeGenerator
+
PrjSamplesResource.Designer.cs
-
-
ResXFileCodeGenerator
+
+
SlnSamplesResource.Designer.cs
- Designer
+ ResXFileCodeGenerator
-
-
-
-
- This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
-
-
-
-
-
-
\ No newline at end of file
+
+
diff --git a/MvsSlnTest/PrjSamplesResource.Designer.cs b/MvsSlnTest/PrjSamplesResource.Designer.cs
index d44ffd2..c843497 100644
--- a/MvsSlnTest/PrjSamplesResource.Designer.cs
+++ b/MvsSlnTest/PrjSamplesResource.Designer.cs
@@ -8,7 +8,7 @@
//
//------------------------------------------------------------------------------
-namespace net.r_eg.MvsSlnTest {
+namespace MvsSlnTest {
using System;
@@ -19,7 +19,7 @@ namespace net.r_eg.MvsSlnTest {
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class PrjSamplesResource {
@@ -39,7 +39,7 @@ internal PrjSamplesResource() {
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("net.r_eg.MvsSlnTest.PrjSamplesResource", typeof(PrjSamplesResource).Assembly);
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MvsSlnTest.PrjSamplesResource", typeof(PrjSamplesResource).Assembly);
resourceMan = temp;
}
return resourceMan;
diff --git a/MvsSlnTest/PrjSamplesResource.resx b/MvsSlnTest/PrjSamplesResource.resx
index 76d5078..3475aa5 100644
--- a/MvsSlnTest/PrjSamplesResource.resx
+++ b/MvsSlnTest/PrjSamplesResource.resx
@@ -207,7 +207,7 @@
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
- <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" Condition="Exists('$(MSBuildToolsPath)\Microsoft.CSharp.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
diff --git a/MvsSlnTest/Projects/ItemTest.cs b/MvsSlnTest/Projects/ItemTest.cs
index 9e69cc7..eecc4ce 100644
--- a/MvsSlnTest/Projects/ItemTest.cs
+++ b/MvsSlnTest/Projects/ItemTest.cs
@@ -1,46 +1,45 @@
-using Microsoft.VisualStudio.TestTools.UnitTesting;
-using net.r_eg.MvsSln.Projects;
+using net.r_eg.MvsSln.Projects;
+using Xunit;
-namespace net.r_eg.MvsSlnTest.Projects
+namespace MvsSlnTest.Projects
{
- [TestClass]
public class ItemTest
{
- [TestMethod]
+ [Fact]
public void ParseTest1()
{
var target1 = new Item() { unevaluatedInclude = "System.Core", evaluatedInclude = "System.Xml" };
- Assert.AreEqual("System.Xml", target1.Assembly.Info.Name);
+ Assert.Equal("System.Xml", target1.Assembly.Info.Name);
var target2 = new Item() { unevaluatedInclude = "System.Core" };
- Assert.AreEqual("System.Core", target2.Assembly.Info.Name);
+ Assert.Equal("System.Core", target2.Assembly.Info.Name);
var target3 = new Item() { evaluatedInclude = "System.Xml" };
- Assert.AreEqual("System.Xml", target3.Assembly.Info.Name);
+ Assert.Equal("System.Xml", target3.Assembly.Info.Name);
}
- [TestMethod]
+ [Fact]
public void ParseTest2()
{
var target1 = new Item() { evaluatedInclude = "packages\\DllExport.dll" };
- Assert.AreEqual(null, target1.Assembly.Info);
+ Assert.Null(target1.Assembly.Info);
var target2 = new Item() { evaluatedInclude = "packages/DllExport.dll" };
- Assert.AreEqual(null, target2.Assembly.Info);
+ Assert.Null(target2.Assembly.Info);
var target3 = new Item();
- Assert.AreEqual(null, target3.Assembly.Info);
+ Assert.Null(target3.Assembly.Info);
}
- [TestMethod]
+ [Fact]
public void ParseTest3()
{
var target1 = new Item() {
evaluatedInclude = "DllExport, Version=1.5.2.34258, Culture=neutral, PublicKeyToken=8337224c9ad9e356"
};
- Assert.AreEqual("DllExport, Version=1.5.2.34258, Culture=neutral, PublicKeyToken=8337224c9ad9e356", target1.Assembly.Info.FullName);
- Assert.AreEqual("DllExport", target1.Assembly.Info.Name);
+ Assert.Equal("DllExport, Version=1.5.2.34258, Culture=neutral, PublicKeyToken=8337224c9ad9e356", target1.Assembly.Info.FullName);
+ Assert.Equal("DllExport", target1.Assembly.Info.Name);
}
}
}
diff --git a/MvsSlnTest/Properties/AssemblyInfo.cs b/MvsSlnTest/Properties/AssemblyInfo.cs
deleted file mode 100644
index 2022aed..0000000
--- a/MvsSlnTest/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-[assembly: AssemblyTitle("MvsSlnTest")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("MvsSlnTest")]
-[assembly: AssemblyCopyright("")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-[assembly: ComVisible(false)]
-
-[assembly: Guid("ec0ca220-39ec-41e5-b9d6-88d8f860f979")]
-
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/MvsSlnTest/SlnSamplesResource.Designer.cs b/MvsSlnTest/SlnSamplesResource.Designer.cs
index b9b06e6..ec17f8d 100644
--- a/MvsSlnTest/SlnSamplesResource.Designer.cs
+++ b/MvsSlnTest/SlnSamplesResource.Designer.cs
@@ -8,7 +8,7 @@
//
//------------------------------------------------------------------------------
-namespace net.r_eg.MvsSlnTest {
+namespace MvsSlnTest {
using System;
@@ -39,7 +39,7 @@ internal SlnSamplesResource() {
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("net.r_eg.MvsSlnTest.SlnSamplesResource", typeof(SlnSamplesResource).Assembly);
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MvsSlnTest.SlnSamplesResource", typeof(SlnSamplesResource).Assembly);
resourceMan = temp;
}
return resourceMan;
diff --git a/MvsSlnTest/SlnTest.cs b/MvsSlnTest/SlnTest.cs
index d3b7f84..8527210 100644
--- a/MvsSlnTest/SlnTest.cs
+++ b/MvsSlnTest/SlnTest.cs
@@ -2,366 +2,365 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
-using Microsoft.VisualStudio.TestTools.UnitTesting;
using net.r_eg.MvsSln;
using net.r_eg.MvsSln.Core;
using net.r_eg.MvsSln.Core.SlnHandlers;
+using Xunit;
-namespace net.r_eg.MvsSlnTest
+namespace MvsSlnTest
{
- [TestClass]
public class SlnTest
{
- [TestMethod]
+ [Fact]
public void SlnResultTest1()
{
using(var sln = new Sln(SlnItems.Projects, SlnSamplesResource.vsSolutionBuildEvent))
{
- Assert.AreEqual("\\", sln.Result.SolutionDir);
- Assert.AreEqual(SlnParser.MEM_FILE, sln.Result.Properties[PropertyNames.SLN_PATH]);
-
- Assert.AreEqual(sln.Result.SolutionDir, sln.Result.Properties[PropertyNames.SLN_DIR]);
- Assert.AreEqual(Path.GetExtension(SlnParser.MEM_FILE), sln.Result.Properties[PropertyNames.SLN_EXT]);
- Assert.AreEqual(Path.GetFileName(SlnParser.MEM_FILE), sln.Result.Properties[PropertyNames.SLN_FNAME]);
- Assert.AreEqual(Path.GetFileNameWithoutExtension(SlnParser.MEM_FILE), sln.Result.Properties[PropertyNames.SLN_NAME]);
- Assert.AreEqual(null, sln.Result.Properties[PropertyNames.CONFIG]);
- Assert.AreEqual(null, sln.Result.Properties[PropertyNames.PLATFORM]);
+ Assert.Equal("\\", sln.Result.SolutionDir);
+ Assert.Equal(SlnParser.MEM_FILE, sln.Result.Properties[PropertyNames.SLN_PATH]);
+
+ Assert.Equal(sln.Result.SolutionDir, sln.Result.Properties[PropertyNames.SLN_DIR]);
+ Assert.Equal(Path.GetExtension(SlnParser.MEM_FILE), sln.Result.Properties[PropertyNames.SLN_EXT]);
+ Assert.Equal(Path.GetFileName(SlnParser.MEM_FILE), sln.Result.Properties[PropertyNames.SLN_FNAME]);
+ Assert.Equal(Path.GetFileNameWithoutExtension(SlnParser.MEM_FILE), sln.Result.Properties[PropertyNames.SLN_NAME]);
+ Assert.Null(sln.Result.Properties[PropertyNames.CONFIG]);
+ Assert.Null(sln.Result.Properties[PropertyNames.PLATFORM]);
}
}
- [TestMethod]
+ [Fact]
public void SlnResultTest2()
{
using(var sln = new Sln(SlnItems.Projects, SlnSamplesResource.vsSolutionBuildEvent))
{
- Assert.AreEqual(8, sln.Result.ProjectItems.Count());
+ Assert.Equal(8, sln.Result.ProjectItems.Count());
var p0 = sln.Result.ProjectItems.ElementAt(0);
- Assert.AreEqual("{A7BF1F9C-F18D-423E-9354-859DC3CFAFD4}", p0.pGuid);
- Assert.AreEqual("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}", p0.pType);
- Assert.AreEqual("CIMLib", p0.name);
- Assert.AreEqual("CIMLib\\CIMLib.csproj", p0.path);
+ Assert.Equal("{A7BF1F9C-F18D-423E-9354-859DC3CFAFD4}", p0.pGuid);
+ Assert.Equal("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}", p0.pType);
+ Assert.Equal("CIMLib", p0.name);
+ Assert.Equal("CIMLib\\CIMLib.csproj", p0.path);
var p1 = sln.Result.ProjectItems.ElementAt(1);
- Assert.AreEqual("{32E44995-F621-4E77-B46A-8F65D64E7FEA}", p1.pGuid);
- Assert.AreEqual("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}", p1.pType);
- Assert.AreEqual("vsSolutionBuildEvent", p1.name);
- Assert.AreEqual("vsSolutionBuildEvent\\vsSolutionBuildEvent.csproj", p1.path);
+ Assert.Equal("{32E44995-F621-4E77-B46A-8F65D64E7FEA}", p1.pGuid);
+ Assert.Equal("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}", p1.pType);
+ Assert.Equal("vsSolutionBuildEvent", p1.name);
+ Assert.Equal("vsSolutionBuildEvent\\vsSolutionBuildEvent.csproj", p1.path);
var p2 = sln.Result.ProjectItems.ElementAt(2);
- Assert.AreEqual("{C00D04E8-8101-42F5-89DA-CBAD205CC1D3}", p2.pGuid);
- Assert.AreEqual("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}", p2.pType);
- Assert.AreEqual("vsSolutionBuildEventTest", p2.name);
- Assert.AreEqual("vsSolutionBuildEventTest\\vsSolutionBuildEventTest.csproj", p2.path);
+ Assert.Equal("{C00D04E8-8101-42F5-89DA-CBAD205CC1D3}", p2.pGuid);
+ Assert.Equal("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}", p2.pType);
+ Assert.Equal("vsSolutionBuildEventTest", p2.name);
+ Assert.Equal("vsSolutionBuildEventTest\\vsSolutionBuildEventTest.csproj", p2.path);
var p3 = sln.Result.ProjectItems.ElementAt(3);
- Assert.AreEqual("{73919171-44B6-4536-B892-F1FCA653887C}", p3.pGuid);
- Assert.AreEqual("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}", p3.pType);
- Assert.AreEqual("Bridge", p3.name);
- Assert.AreEqual("Bridge\\Bridge.csproj", p3.path);
+ Assert.Equal("{73919171-44B6-4536-B892-F1FCA653887C}", p3.pGuid);
+ Assert.Equal("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}", p3.pType);
+ Assert.Equal("Bridge", p3.name);
+ Assert.Equal("Bridge\\Bridge.csproj", p3.path);
var p4 = sln.Result.ProjectItems.ElementAt(4);
- Assert.AreEqual("{56437CBB-4AE5-4405-B928-600009D60E2D}", p4.pGuid);
- Assert.AreEqual("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}", p4.pType);
- Assert.AreEqual("Devenv", p4.name);
- Assert.AreEqual("Devenv\\Devenv.csproj", p4.path);
+ Assert.Equal("{56437CBB-4AE5-4405-B928-600009D60E2D}", p4.pGuid);
+ Assert.Equal("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}", p4.pType);
+ Assert.Equal("Devenv", p4.name);
+ Assert.Equal("Devenv\\Devenv.csproj", p4.path);
var p5 = sln.Result.ProjectItems.ElementAt(5);
- Assert.AreEqual("{97F0E2FF-42DB-4506-856D-8694DD99F827}", p5.pGuid);
- Assert.AreEqual("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}", p5.pType);
- Assert.AreEqual("CI.MSBuild", p5.name);
- Assert.AreEqual("CI.MSBuild\\CI.MSBuild.csproj", p5.path);
+ Assert.Equal("{97F0E2FF-42DB-4506-856D-8694DD99F827}", p5.pGuid);
+ Assert.Equal("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}", p5.pType);
+ Assert.Equal("CI.MSBuild", p5.name);
+ Assert.Equal("CI.MSBuild\\CI.MSBuild.csproj", p5.path);
var p6 = sln.Result.ProjectItems.ElementAt(6);
- Assert.AreEqual("{4F8BB8CD-1116-4F07-9B8F-06D69FB8589B}", p6.pGuid);
- Assert.AreEqual("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}", p6.pType);
- Assert.AreEqual("Provider", p6.name);
- Assert.AreEqual("Provider\\Provider.csproj", p6.path);
+ Assert.Equal("{4F8BB8CD-1116-4F07-9B8F-06D69FB8589B}", p6.pGuid);
+ Assert.Equal("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}", p6.pType);
+ Assert.Equal("Provider", p6.name);
+ Assert.Equal("Provider\\Provider.csproj", p6.path);
var p7 = sln.Result.ProjectItems.ElementAt(7);
- Assert.AreEqual("{9673A8FC-07E1-4BB3-A97E-020481A5275E}", p7.pGuid);
- Assert.AreEqual("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}", p7.pType);
- Assert.AreEqual("ClientDemo", p7.name);
- Assert.AreEqual("ClientDemo\\ClientDemo.csproj", p7.path);
+ Assert.Equal("{9673A8FC-07E1-4BB3-A97E-020481A5275E}", p7.pGuid);
+ Assert.Equal("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}", p7.pType);
+ Assert.Equal("ClientDemo", p7.name);
+ Assert.Equal("ClientDemo\\ClientDemo.csproj", p7.path);
}
}
- [TestMethod]
+ [Fact]
public void SlnResultTest3()
{
using(var sln = new Sln(SlnItems.SolutionConfPlatforms, SlnSamplesResource.vsSolutionBuildEvent))
{
- Assert.AreEqual(new ConfigItem("Debug", "Any CPU"), sln.Result.DefaultConfig);
-
- Assert.AreEqual(8, sln.Result.SolutionConfigs.Count());
-
- Assert.AreEqual(new ConfigItem("CI_Debug_net45", "Any CPU"), sln.Result.SolutionConfigs.ElementAt(0));
- Assert.AreEqual(new ConfigItem("CI_Debug", "Any CPU"), sln.Result.SolutionConfigs.ElementAt(1));
- Assert.AreEqual(new ConfigItem("CI_Release_net45", "Any CPU"), sln.Result.SolutionConfigs.ElementAt(2));
- Assert.AreEqual(new ConfigItem("CI_Release", "Any CPU"), sln.Result.SolutionConfigs.ElementAt(3));
- Assert.AreEqual(new ConfigItem("Debug_net45", "Any CPU"), sln.Result.SolutionConfigs.ElementAt(4));
- Assert.AreEqual(new ConfigItem("Debug", "Any CPU"), sln.Result.SolutionConfigs.ElementAt(5));
- Assert.AreEqual(new ConfigItem("Release_net45", "Any CPU"), sln.Result.SolutionConfigs.ElementAt(6));
- Assert.AreEqual(new ConfigItem("Release", "Any CPU"), sln.Result.SolutionConfigs.ElementAt(7));
+ Assert.Equal(new ConfigItem("Debug", "Any CPU"), sln.Result.DefaultConfig);
+
+ Assert.Equal(8, sln.Result.SolutionConfigs.Count());
+
+ Assert.Equal(new ConfigItem("CI_Debug_net45", "Any CPU"), sln.Result.SolutionConfigs.ElementAt(0));
+ Assert.Equal(new ConfigItem("CI_Debug", "Any CPU"), sln.Result.SolutionConfigs.ElementAt(1));
+ Assert.Equal(new ConfigItem("CI_Release_net45", "Any CPU"), sln.Result.SolutionConfigs.ElementAt(2));
+ Assert.Equal(new ConfigItem("CI_Release", "Any CPU"), sln.Result.SolutionConfigs.ElementAt(3));
+ Assert.Equal(new ConfigItem("Debug_net45", "Any CPU"), sln.Result.SolutionConfigs.ElementAt(4));
+ Assert.Equal(new ConfigItem("Debug", "Any CPU"), sln.Result.SolutionConfigs.ElementAt(5));
+ Assert.Equal(new ConfigItem("Release_net45", "Any CPU"), sln.Result.SolutionConfigs.ElementAt(6));
+ Assert.Equal(new ConfigItem("Release", "Any CPU"), sln.Result.SolutionConfigs.ElementAt(7));
}
}
- [TestMethod]
+ [Fact]
public void SlnResultTest4()
{
using(var sln = new Sln(SlnItems.ProjectConfPlatforms, SlnSamplesResource.vsSolutionBuildEvent))
{
- Assert.AreEqual(6, sln.Result.ProjectConfigs.Count());
+ Assert.Equal(6, sln.Result.ProjectConfigs.Count());
var cfg0 = sln.Result.ProjectConfigs.ElementAt(0);
- Assert.AreEqual(new ConfigItem("Release_net45", "x64"), (ConfigItem)cfg0);
- Assert.AreEqual(false, cfg0.IncludeInBuild);
- Assert.AreEqual(false, cfg0.IncludeInDeploy);
- Assert.AreEqual("{A7BF1F9C-F18D-423E-9354-859DC3CFAFD4}", cfg0.PGuid);
- Assert.AreEqual(new ConfigItem("CI_Debug_net45", "Any CPU"), cfg0.Sln);
+ Assert.Equal(new ConfigItem("Release_net45", "x64"), (ConfigItem)cfg0);
+ Assert.False(cfg0.IncludeInBuild);
+ Assert.False(cfg0.IncludeInDeploy);
+ Assert.Equal("{A7BF1F9C-F18D-423E-9354-859DC3CFAFD4}", cfg0.PGuid);
+ Assert.Equal(new ConfigItem("CI_Debug_net45", "Any CPU"), cfg0.Sln);
var cfg1 = sln.Result.ProjectConfigs.ElementAt(1);
- Assert.AreEqual(new ConfigItem("Release", "x64"), (ConfigItem)cfg1);
- Assert.AreEqual(true, cfg1.IncludeInBuild);
- Assert.AreEqual(false, cfg1.IncludeInDeploy);
- Assert.AreEqual("{A7BF1F9C-F18D-423E-9354-859DC3CFAFD4}", cfg1.PGuid);
- Assert.AreEqual(new ConfigItem("CI_Debug", "Any CPU"), cfg1.Sln);
+ Assert.Equal(new ConfigItem("Release", "x64"), (ConfigItem)cfg1);
+ Assert.True(cfg1.IncludeInBuild);
+ Assert.False(cfg1.IncludeInDeploy);
+ Assert.Equal("{A7BF1F9C-F18D-423E-9354-859DC3CFAFD4}", cfg1.PGuid);
+ Assert.Equal(new ConfigItem("CI_Debug", "Any CPU"), cfg1.Sln);
var cfg2 = sln.Result.ProjectConfigs.ElementAt(2);
- Assert.AreEqual(new ConfigItem("Release_net45", "Any CPU"), (ConfigItem)cfg2);
- Assert.AreEqual(false, cfg2.IncludeInBuild);
- Assert.AreEqual(false, cfg2.IncludeInDeploy);
- Assert.AreEqual("{A7BF1F9C-F18D-423E-9354-859DC3CFAFD4}", cfg2.PGuid);
- Assert.AreEqual(new ConfigItem("CI_Release_net45", "Any CPU"), cfg2.Sln);
+ Assert.Equal(new ConfigItem("Release_net45", "Any CPU"), (ConfigItem)cfg2);
+ Assert.False(cfg2.IncludeInBuild);
+ Assert.False(cfg2.IncludeInDeploy);
+ Assert.Equal("{A7BF1F9C-F18D-423E-9354-859DC3CFAFD4}", cfg2.PGuid);
+ Assert.Equal(new ConfigItem("CI_Release_net45", "Any CPU"), cfg2.Sln);
var cfg3 = sln.Result.ProjectConfigs.ElementAt(3);
- Assert.AreEqual(new ConfigItem("Release", "Any CPU"), (ConfigItem)cfg3);
- Assert.AreEqual(true, cfg3.IncludeInBuild);
- Assert.AreEqual(true, cfg3.IncludeInDeploy);
- Assert.AreEqual("{A7BF1F9C-F18D-423E-9354-859DC3CFAFD4}", cfg3.PGuid);
- Assert.AreEqual(new ConfigItem("CI_Release", "Any CPU"), cfg3.Sln);
+ Assert.Equal(new ConfigItem("Release", "Any CPU"), (ConfigItem)cfg3);
+ Assert.True(cfg3.IncludeInBuild);
+ Assert.True(cfg3.IncludeInDeploy);
+ Assert.Equal("{A7BF1F9C-F18D-423E-9354-859DC3CFAFD4}", cfg3.PGuid);
+ Assert.Equal(new ConfigItem("CI_Release", "Any CPU"), cfg3.Sln);
var cfg4 = sln.Result.ProjectConfigs.ElementAt(4);
- Assert.AreEqual(new ConfigItem("Debug", "x86"), (ConfigItem)cfg4);
- Assert.AreEqual(true, cfg4.IncludeInBuild);
- Assert.AreEqual(false, cfg4.IncludeInDeploy);
- Assert.AreEqual("{32E44995-F621-4E77-B46A-8F65D64E7FEA}", cfg4.PGuid);
- Assert.AreEqual(new ConfigItem("Debug", "Any CPU"), cfg4.Sln);
+ Assert.Equal(new ConfigItem("Debug", "x86"), (ConfigItem)cfg4);
+ Assert.True(cfg4.IncludeInBuild);
+ Assert.False(cfg4.IncludeInDeploy);
+ Assert.Equal("{32E44995-F621-4E77-B46A-8F65D64E7FEA}", cfg4.PGuid);
+ Assert.Equal(new ConfigItem("Debug", "Any CPU"), cfg4.Sln);
var cfg5 = sln.Result.ProjectConfigs.ElementAt(5);
- Assert.AreEqual(new ConfigItem("Release", "Any CPU"), (ConfigItem)cfg5);
- Assert.AreEqual(true, cfg5.IncludeInBuild);
- Assert.AreEqual(false, cfg5.IncludeInDeploy);
- Assert.AreEqual("{32E44995-F621-4E77-B46A-8F65D64E7FEA}", cfg5.PGuid);
- Assert.AreEqual(new ConfigItem("Release", "Any CPU"), cfg5.Sln);
+ Assert.Equal(new ConfigItem("Release", "Any CPU"), (ConfigItem)cfg5);
+ Assert.True(cfg5.IncludeInBuild);
+ Assert.False(cfg5.IncludeInDeploy);
+ Assert.Equal("{32E44995-F621-4E77-B46A-8F65D64E7FEA}", cfg5.PGuid);
+ Assert.Equal(new ConfigItem("Release", "Any CPU"), cfg5.Sln);
}
}
- [TestMethod]
+ [Fact]
public void SlnResultTest5()
{
using(var sln = new Sln(SlnItems.ProjectDependencies, SlnSamplesResource.vsSolutionBuildEvent))
{
- Assert.AreEqual(8, sln.Result.ProjectDependencies.Projects.Count());
-
- Assert.AreEqual("{A7BF1F9C-F18D-423E-9354-859DC3CFAFD4}", sln.Result.ProjectDependencies.FirstProject.pGuid);
- Assert.AreEqual("{9673A8FC-07E1-4BB3-A97E-020481A5275E}", sln.Result.ProjectDependencies.LastProject.pGuid);
-
- Assert.AreEqual(8, sln.Result.ProjectDependencies.GuidList.Count());
- Assert.AreEqual("{A7BF1F9C-F18D-423E-9354-859DC3CFAFD4}", sln.Result.ProjectDependencies.GuidList[0]);
- Assert.AreEqual("{73919171-44B6-4536-B892-F1FCA653887C}", sln.Result.ProjectDependencies.GuidList[1]);
- Assert.AreEqual("{32E44995-F621-4E77-B46A-8F65D64E7FEA}", sln.Result.ProjectDependencies.GuidList[2]);
- Assert.AreEqual("{C00D04E8-8101-42F5-89DA-CBAD205CC1D3}", sln.Result.ProjectDependencies.GuidList[3]);
- Assert.AreEqual("{56437CBB-4AE5-4405-B928-600009D60E2D}", sln.Result.ProjectDependencies.GuidList[4]);
- Assert.AreEqual("{97F0E2FF-42DB-4506-856D-8694DD99F827}", sln.Result.ProjectDependencies.GuidList[5]);
- Assert.AreEqual("{4F8BB8CD-1116-4F07-9B8F-06D69FB8589B}", sln.Result.ProjectDependencies.GuidList[6]);
- Assert.AreEqual("{9673A8FC-07E1-4BB3-A97E-020481A5275E}", sln.Result.ProjectDependencies.GuidList[7]);
-
- Assert.AreEqual(8, sln.Result.ProjectDependencies.Dependencies.Count());
- Assert.AreEqual(0, sln.Result.ProjectDependencies.Dependencies["{A7BF1F9C-F18D-423E-9354-859DC3CFAFD4}"].Count);
- Assert.AreEqual(2, sln.Result.ProjectDependencies.Dependencies["{32E44995-F621-4E77-B46A-8F65D64E7FEA}"].Count);
+ Assert.Equal(8, sln.Result.ProjectDependencies.Projects.Count());
+
+ Assert.Equal("{A7BF1F9C-F18D-423E-9354-859DC3CFAFD4}", sln.Result.ProjectDependencies.FirstProject.pGuid);
+ Assert.Equal("{9673A8FC-07E1-4BB3-A97E-020481A5275E}", sln.Result.ProjectDependencies.LastProject.pGuid);
+
+ Assert.Equal(8, sln.Result.ProjectDependencies.GuidList.Count());
+ Assert.Equal("{A7BF1F9C-F18D-423E-9354-859DC3CFAFD4}", sln.Result.ProjectDependencies.GuidList[0]);
+ Assert.Equal("{73919171-44B6-4536-B892-F1FCA653887C}", sln.Result.ProjectDependencies.GuidList[1]);
+ Assert.Equal("{32E44995-F621-4E77-B46A-8F65D64E7FEA}", sln.Result.ProjectDependencies.GuidList[2]);
+ Assert.Equal("{C00D04E8-8101-42F5-89DA-CBAD205CC1D3}", sln.Result.ProjectDependencies.GuidList[3]);
+ Assert.Equal("{56437CBB-4AE5-4405-B928-600009D60E2D}", sln.Result.ProjectDependencies.GuidList[4]);
+ Assert.Equal("{97F0E2FF-42DB-4506-856D-8694DD99F827}", sln.Result.ProjectDependencies.GuidList[5]);
+ Assert.Equal("{4F8BB8CD-1116-4F07-9B8F-06D69FB8589B}", sln.Result.ProjectDependencies.GuidList[6]);
+ Assert.Equal("{9673A8FC-07E1-4BB3-A97E-020481A5275E}", sln.Result.ProjectDependencies.GuidList[7]);
+
+ Assert.Equal(8, sln.Result.ProjectDependencies.Dependencies.Count());
+ Assert.Empty(sln.Result.ProjectDependencies.Dependencies["{A7BF1F9C-F18D-423E-9354-859DC3CFAFD4}"]);
+ Assert.Equal(2, sln.Result.ProjectDependencies.Dependencies["{32E44995-F621-4E77-B46A-8F65D64E7FEA}"].Count);
{
- Assert.AreEqual(true, sln.Result.ProjectDependencies.Dependencies["{32E44995-F621-4E77-B46A-8F65D64E7FEA}"].Contains("{73919171-44B6-4536-B892-F1FCA653887C}"));
- Assert.AreEqual(true, sln.Result.ProjectDependencies.Dependencies["{32E44995-F621-4E77-B46A-8F65D64E7FEA}"].Contains("{A7BF1F9C-F18D-423E-9354-859DC3CFAFD4}"));
+ Assert.Contains("{73919171-44B6-4536-B892-F1FCA653887C}", sln.Result.ProjectDependencies.Dependencies["{32E44995-F621-4E77-B46A-8F65D64E7FEA}"]);
+ Assert.Contains("{A7BF1F9C-F18D-423E-9354-859DC3CFAFD4}", sln.Result.ProjectDependencies.Dependencies["{32E44995-F621-4E77-B46A-8F65D64E7FEA}"]);
}
- Assert.AreEqual(0, sln.Result.ProjectDependencies.Dependencies["{C00D04E8-8101-42F5-89DA-CBAD205CC1D3}"].Count);
- Assert.AreEqual(0, sln.Result.ProjectDependencies.Dependencies["{73919171-44B6-4536-B892-F1FCA653887C}"].Count);
- Assert.AreEqual(1, sln.Result.ProjectDependencies.Dependencies["{56437CBB-4AE5-4405-B928-600009D60E2D}"].Count);
+ Assert.Empty(sln.Result.ProjectDependencies.Dependencies["{C00D04E8-8101-42F5-89DA-CBAD205CC1D3}"]);
+ Assert.Empty(sln.Result.ProjectDependencies.Dependencies["{73919171-44B6-4536-B892-F1FCA653887C}"]);
+ Assert.Single(sln.Result.ProjectDependencies.Dependencies["{56437CBB-4AE5-4405-B928-600009D60E2D}"]);
{
- Assert.AreEqual(true, sln.Result.ProjectDependencies.Dependencies["{56437CBB-4AE5-4405-B928-600009D60E2D}"].Contains("{73919171-44B6-4536-B892-F1FCA653887C}"));
+ Assert.Contains("{73919171-44B6-4536-B892-F1FCA653887C}", sln.Result.ProjectDependencies.Dependencies["{56437CBB-4AE5-4405-B928-600009D60E2D}"]);
}
- Assert.AreEqual(0, sln.Result.ProjectDependencies.Dependencies["{97F0E2FF-42DB-4506-856D-8694DD99F827}"].Count);
- Assert.AreEqual(0, sln.Result.ProjectDependencies.Dependencies["{4F8BB8CD-1116-4F07-9B8F-06D69FB8589B}"].Count);
- Assert.AreEqual(0, sln.Result.ProjectDependencies.Dependencies["{9673A8FC-07E1-4BB3-A97E-020481A5275E}"].Count);
+ Assert.Empty(sln.Result.ProjectDependencies.Dependencies["{97F0E2FF-42DB-4506-856D-8694DD99F827}"]);
+ Assert.Empty(sln.Result.ProjectDependencies.Dependencies["{4F8BB8CD-1116-4F07-9B8F-06D69FB8589B}"]);
+ Assert.Empty(sln.Result.ProjectDependencies.Dependencies["{9673A8FC-07E1-4BB3-A97E-020481A5275E}"]);
}
}
- [TestMethod]
+ [Fact]
public void SlnResultTest6()
{
using(var sln = new Sln(SlnItems.ProjectConfPlatforms, SlnSamplesResource.ConfNamesDots))
{
- Assert.AreEqual(6, sln.Result.ProjectConfigs.Count());
+ Assert.Equal(6, sln.Result.ProjectConfigs.Count());
var cfg = sln.Result.ProjectConfigs.ElementAt(0);
- Assert.AreEqual(new ConfigItem("Release.net45", "x64"), (ConfigItem)cfg);
- Assert.AreEqual(false, cfg.IncludeInBuild);
- Assert.AreEqual(false, cfg.IncludeInDeploy);
- Assert.AreEqual("{A7BF1F9C-F18D-423E-9354-859DC3CFAFD4}", cfg.PGuid);
- Assert.AreEqual(new ConfigItem("CI.Debug.net45", "Any.CPU.etc"), cfg.Sln);
+ Assert.Equal(new ConfigItem("Release.net45", "x64"), (ConfigItem)cfg);
+ Assert.False(cfg.IncludeInBuild);
+ Assert.False(cfg.IncludeInDeploy);
+ Assert.Equal("{A7BF1F9C-F18D-423E-9354-859DC3CFAFD4}", cfg.PGuid);
+ Assert.Equal(new ConfigItem("CI.Debug.net45", "Any.CPU.etc"), cfg.Sln);
cfg = sln.Result.ProjectConfigs.ElementAt(1);
- Assert.AreEqual(new ConfigItem("Release", "x64"), (ConfigItem)cfg);
- Assert.AreEqual(true, cfg.IncludeInBuild);
- Assert.AreEqual(false, cfg.IncludeInDeploy);
- Assert.AreEqual("{A7BF1F9C-F18D-423E-9354-859DC3CFAFD4}", cfg.PGuid);
- Assert.AreEqual(new ConfigItem("CI.Debug", "Any.CPU.etc"), cfg.Sln);
+ Assert.Equal(new ConfigItem("Release", "x64"), (ConfigItem)cfg);
+ Assert.True(cfg.IncludeInBuild);
+ Assert.False(cfg.IncludeInDeploy);
+ Assert.Equal("{A7BF1F9C-F18D-423E-9354-859DC3CFAFD4}", cfg.PGuid);
+ Assert.Equal(new ConfigItem("CI.Debug", "Any.CPU.etc"), cfg.Sln);
cfg = sln.Result.ProjectConfigs.ElementAt(2);
- Assert.AreEqual(new ConfigItem("Release.net45", "Any.CPU.etc"), (ConfigItem)cfg);
- Assert.AreEqual(false, cfg.IncludeInBuild);
- Assert.AreEqual(false, cfg.IncludeInDeploy);
- Assert.AreEqual("{A7BF1F9C-F18D-423E-9354-859DC3CFAFD4}", cfg.PGuid);
- Assert.AreEqual(new ConfigItem("CI.Release.net45", "Any.CPU.etc"), cfg.Sln);
+ Assert.Equal(new ConfigItem("Release.net45", "Any.CPU.etc"), (ConfigItem)cfg);
+ Assert.False(cfg.IncludeInBuild);
+ Assert.False(cfg.IncludeInDeploy);
+ Assert.Equal("{A7BF1F9C-F18D-423E-9354-859DC3CFAFD4}", cfg.PGuid);
+ Assert.Equal(new ConfigItem("CI.Release.net45", "Any.CPU.etc"), cfg.Sln);
cfg = sln.Result.ProjectConfigs.ElementAt(3);
- Assert.AreEqual(new ConfigItem("Release", "Any.CPU.etc"), (ConfigItem)cfg);
- Assert.AreEqual(true, cfg.IncludeInBuild);
- Assert.AreEqual(true, cfg.IncludeInDeploy);
- Assert.AreEqual("{A7BF1F9C-F18D-423E-9354-859DC3CFAFD4}", cfg.PGuid);
- Assert.AreEqual(new ConfigItem("CI.Release", "Any.CPU.etc"), cfg.Sln);
+ Assert.Equal(new ConfigItem("Release", "Any.CPU.etc"), (ConfigItem)cfg);
+ Assert.True(cfg.IncludeInBuild);
+ Assert.True(cfg.IncludeInDeploy);
+ Assert.Equal("{A7BF1F9C-F18D-423E-9354-859DC3CFAFD4}", cfg.PGuid);
+ Assert.Equal(new ConfigItem("CI.Release", "Any.CPU.etc"), cfg.Sln);
cfg = sln.Result.ProjectConfigs.ElementAt(4);
- Assert.AreEqual(new ConfigItem("Debug.x64.x86", "x86"), (ConfigItem)cfg);
- Assert.AreEqual(true, cfg.IncludeInBuild);
- Assert.AreEqual(false, cfg.IncludeInDeploy);
- Assert.AreEqual("{32E44995-F621-4E77-B46A-8F65D64E7FEA}", cfg.PGuid);
- Assert.AreEqual(new ConfigItem("Debug.x64.x86", "Any.CPU.etc"), cfg.Sln);
+ Assert.Equal(new ConfigItem("Debug.x64.x86", "x86"), (ConfigItem)cfg);
+ Assert.True(cfg.IncludeInBuild);
+ Assert.False(cfg.IncludeInDeploy);
+ Assert.Equal("{32E44995-F621-4E77-B46A-8F65D64E7FEA}", cfg.PGuid);
+ Assert.Equal(new ConfigItem("Debug.x64.x86", "Any.CPU.etc"), cfg.Sln);
cfg = sln.Result.ProjectConfigs.ElementAt(5);
- Assert.AreEqual(new ConfigItem("Release", "Any.CPU.etc"), (ConfigItem)cfg);
- Assert.AreEqual(true, cfg.IncludeInBuild);
- Assert.AreEqual(false, cfg.IncludeInDeploy);
- Assert.AreEqual("{32E44995-F621-4E77-B46A-8F65D64E7FEA}", cfg.PGuid);
- Assert.AreEqual(new ConfigItem("Release", "Any.CPU.etc"), cfg.Sln);
+ Assert.Equal(new ConfigItem("Release", "Any.CPU.etc"), (ConfigItem)cfg);
+ Assert.True(cfg.IncludeInBuild);
+ Assert.False(cfg.IncludeInDeploy);
+ Assert.Equal("{32E44995-F621-4E77-B46A-8F65D64E7FEA}", cfg.PGuid);
+ Assert.Equal(new ConfigItem("Release", "Any.CPU.etc"), cfg.Sln);
}
}
- [TestMethod]
+ [Fact]
public void ExtensibilityGlobalsTest1()
{
using(var sln = new Sln(SlnItems.All &~ SlnItems.ExtItems, SlnSamplesResource.ExtensibilityGlobals))
{
- Assert.AreEqual(null, sln.Result.ExtItems);
+ Assert.Null(sln.Result.ExtItems);
}
}
- [TestMethod]
+ [Fact]
public void ExtensibilityGlobalsTest2()
{
using(var sln = new Sln(SlnItems.ExtItems, SlnSamplesResource.ExtensibilityGlobals))
{
- Assert.AreEqual(4, sln.Result.ExtItems.Count());
+ Assert.Equal(4, sln.Result.ExtItems.Count());
- Assert.AreEqual(true, sln.Result.ExtItems.ContainsKey("SolutionGuid"));
- Assert.AreEqual(true, sln.Result.ExtItems.ContainsKey("SomeOtherEmptyData"));
- Assert.AreEqual(true, sln.Result.ExtItems.ContainsKey("SomeNullData"));
- Assert.AreEqual(true, sln.Result.ExtItems.ContainsKey("EnterpriseLibraryConfigurationToolBinariesPath"));
+ Assert.True(sln.Result.ExtItems.ContainsKey("SolutionGuid"));
+ Assert.True(sln.Result.ExtItems.ContainsKey("SomeOtherEmptyData"));
+ Assert.True(sln.Result.ExtItems.ContainsKey("SomeNullData"));
+ Assert.True(sln.Result.ExtItems.ContainsKey("EnterpriseLibraryConfigurationToolBinariesPath"));
- Assert.AreEqual("{B3244B90-20DE-4D69-8692-EBC686503F90}", sln.Result.ExtItems["SolutionGuid"]);
- Assert.AreEqual(String.Empty, sln.Result.ExtItems["SomeOtherEmptyData"]);
- Assert.AreEqual(null, sln.Result.ExtItems["SomeNullData"]);
- Assert.AreEqual(@"packages\Conari.1.3.0\lib\NET40;packages\vsSBE.CI.MSBuild\bin", sln.Result.ExtItems["EnterpriseLibraryConfigurationToolBinariesPath"]);
+ Assert.Equal("{B3244B90-20DE-4D69-8692-EBC686503F90}", sln.Result.ExtItems["SolutionGuid"]);
+ Assert.Equal(String.Empty, sln.Result.ExtItems["SomeOtherEmptyData"]);
+ Assert.Null(sln.Result.ExtItems["SomeNullData"]);
+ Assert.Equal(@"packages\Conari.1.3.0\lib\NET40;packages\vsSBE.CI.MSBuild\bin", sln.Result.ExtItems["EnterpriseLibraryConfigurationToolBinariesPath"]);
}
}
- [TestMethod]
+ [Fact]
public void SolutionFoldersAndProjectsTest1()
{
using(var sln = new Sln(SlnItems.SolutionItems | SlnItems.Projects, SlnSamplesResource.SolutionFoldersAndProjects))
{
- Assert.AreEqual(4, sln.Result.SolutionFolders.Count());
- Assert.AreEqual(5, sln.Result.ProjectItems.Count());
+ Assert.Equal(4, sln.Result.SolutionFolders.Count());
+ Assert.Equal(5, sln.Result.ProjectItems.Count());
- Assert.AreEqual("dir1", sln.Result.SolutionFolders.ElementAt(0).header.name);
- Assert.AreEqual("{1571A74C-579F-4C91-8484-322B7D89B430}", sln.Result.SolutionFolders.ElementAt(0).header.pGuid);
+ Assert.Equal("dir1", sln.Result.SolutionFolders.ElementAt(0).header.name);
+ Assert.Equal("{1571A74C-579F-4C91-8484-322B7D89B430}", sln.Result.SolutionFolders.ElementAt(0).header.pGuid);
- Assert.AreEqual("subdir1", sln.Result.SolutionFolders.ElementAt(1).header.name);
- Assert.AreEqual("{260202C1-F43A-43E9-A43B-E3E75406A985}", sln.Result.SolutionFolders.ElementAt(1).header.pGuid);
+ Assert.Equal("subdir1", sln.Result.SolutionFolders.ElementAt(1).header.name);
+ Assert.Equal("{260202C1-F43A-43E9-A43B-E3E75406A985}", sln.Result.SolutionFolders.ElementAt(1).header.pGuid);
- Assert.AreEqual("dir3", sln.Result.SolutionFolders.ElementAt(2).header.name);
- Assert.AreEqual("{49B0FC00-2D07-419C-86D4-FDEC8BF0F12C}", sln.Result.SolutionFolders.ElementAt(2).header.pGuid);
+ Assert.Equal("dir3", sln.Result.SolutionFolders.ElementAt(2).header.name);
+ Assert.Equal("{49B0FC00-2D07-419C-86D4-FDEC8BF0F12C}", sln.Result.SolutionFolders.ElementAt(2).header.pGuid);
- Assert.AreEqual("dir2", sln.Result.SolutionFolders.ElementAt(3).header.name);
- Assert.AreEqual("{AB650B89-1B1B-43C6-B254-226B56ACB6EB}", sln.Result.SolutionFolders.ElementAt(3).header.pGuid);
+ Assert.Equal("dir2", sln.Result.SolutionFolders.ElementAt(3).header.name);
+ Assert.Equal("{AB650B89-1B1B-43C6-B254-226B56ACB6EB}", sln.Result.SolutionFolders.ElementAt(3).header.pGuid);
}
}
- [TestMethod]
+ [Fact]
public void SolutionFoldersAndProjectsTest2()
{
using(var sln = new Sln(SlnItems.SolutionItems | SlnItems.Projects, SlnSamplesResource.SolutionFoldersAndProjects))
{
- Assert.AreEqual(4, sln.Result.SolutionFolders.Count());
- Assert.AreEqual(5, sln.Result.ProjectItems.Count());
+ Assert.Equal(4, sln.Result.SolutionFolders.Count());
+ Assert.Equal(5, sln.Result.ProjectItems.Count());
- Assert.AreEqual(0, sln.Result.SolutionFolders.ElementAt(0).items.Count());
- Assert.AreEqual(2, sln.Result.SolutionFolders.ElementAt(1).items.Count());
- Assert.AreEqual(1, sln.Result.SolutionFolders.ElementAt(2).items.Count());
- Assert.AreEqual(0, sln.Result.SolutionFolders.ElementAt(3).items.Count());
+ Assert.Empty(sln.Result.SolutionFolders.ElementAt(0).items);
+ Assert.Equal(2, sln.Result.SolutionFolders.ElementAt(1).items.Count());
+ Assert.Single(sln.Result.SolutionFolders.ElementAt(2).items);
+ Assert.Empty(sln.Result.SolutionFolders.ElementAt(3).items);
- Assert.AreEqual(".gitignore", sln.Result.SolutionFolders.ElementAt(1).items.ElementAt(0).data);
- Assert.AreEqual("Readme.txt", sln.Result.SolutionFolders.ElementAt(1).items.ElementAt(1).data);
+ Assert.Equal(".gitignore", sln.Result.SolutionFolders.ElementAt(1).items.ElementAt(0).data);
+ Assert.Equal("Readme.txt", sln.Result.SolutionFolders.ElementAt(1).items.ElementAt(1).data);
- Assert.AreEqual(".gitattributes", sln.Result.SolutionFolders.ElementAt(2).items.ElementAt(0).data);
+ Assert.Equal(".gitattributes", sln.Result.SolutionFolders.ElementAt(2).items.ElementAt(0).data);
}
}
- [TestMethod]
+ [Fact]
public void SolutionFoldersAndProjectsTest3()
{
using(var sln = new Sln(SlnItems.SolutionItems | SlnItems.Projects, SlnSamplesResource.SolutionFoldersAndProjects))
{
- Assert.AreEqual(null, sln.Result.SolutionFolders.ElementAt(0).header.parent.Value);
+ Assert.Null(sln.Result.SolutionFolders.ElementAt(0).header.parent.Value);
- Assert.AreNotEqual(null, sln.Result.SolutionFolders.ElementAt(1).header.parent.Value);
- Assert.AreEqual("{1571A74C-579F-4C91-8484-322B7D89B430}", sln.Result.SolutionFolders.ElementAt(1).header.parent.Value?.header.pGuid);
- Assert.AreEqual("dir1", sln.Result.SolutionFolders.ElementAt(1).header.parent.Value?.header.name);
+ Assert.NotNull(sln.Result.SolutionFolders.ElementAt(1).header.parent.Value);
+ Assert.Equal("{1571A74C-579F-4C91-8484-322B7D89B430}", sln.Result.SolutionFolders.ElementAt(1).header.parent.Value?.header.pGuid);
+ Assert.Equal("dir1", sln.Result.SolutionFolders.ElementAt(1).header.parent.Value?.header.name);
- Assert.AreNotEqual(null, sln.Result.SolutionFolders.ElementAt(2).header.parent.Value);
- Assert.AreEqual("{260202C1-F43A-43E9-A43B-E3E75406A985}", sln.Result.SolutionFolders.ElementAt(2).header.parent.Value?.header.pGuid);
- Assert.AreEqual("subdir1", sln.Result.SolutionFolders.ElementAt(2).header.parent.Value?.header.name);
+ Assert.NotNull(sln.Result.SolutionFolders.ElementAt(2).header.parent.Value);
+ Assert.Equal("{260202C1-F43A-43E9-A43B-E3E75406A985}", sln.Result.SolutionFolders.ElementAt(2).header.parent.Value?.header.pGuid);
+ Assert.Equal("subdir1", sln.Result.SolutionFolders.ElementAt(2).header.parent.Value?.header.name);
- Assert.AreEqual(null, sln.Result.SolutionFolders.ElementAt(3).header.parent.Value);
+ Assert.Null(sln.Result.SolutionFolders.ElementAt(3).header.parent.Value);
}
}
- [TestMethod]
+ [Fact]
public void SolutionFoldersAndProjectsTest4()
{
using(var sln = new Sln(SlnItems.SolutionItems | SlnItems.Projects, SlnSamplesResource.SolutionFoldersAndProjects))
{
- Assert.AreNotEqual(null, sln.Result.ProjectItems.ElementAt(0).parent.Value);
- Assert.AreEqual("{1571A74C-579F-4C91-8484-322B7D89B430}", sln.Result.ProjectItems.ElementAt(0).parent.Value?.header.pGuid);
- Assert.AreEqual("dir1", sln.Result.ProjectItems.ElementAt(0).parent.Value?.header.name);
+ Assert.NotNull(sln.Result.ProjectItems.ElementAt(0).parent.Value);
+ Assert.Equal("{1571A74C-579F-4C91-8484-322B7D89B430}", sln.Result.ProjectItems.ElementAt(0).parent.Value?.header.pGuid);
+ Assert.Equal("dir1", sln.Result.ProjectItems.ElementAt(0).parent.Value?.header.name);
- Assert.AreNotEqual(null, sln.Result.ProjectItems.ElementAt(1).parent.Value);
- Assert.AreEqual("{260202C1-F43A-43E9-A43B-E3E75406A985}", sln.Result.ProjectItems.ElementAt(1).parent.Value?.header.pGuid);
- Assert.AreEqual("subdir1", sln.Result.ProjectItems.ElementAt(1).parent.Value?.header.name);
+ Assert.NotNull(sln.Result.ProjectItems.ElementAt(1).parent.Value);
+ Assert.Equal("{260202C1-F43A-43E9-A43B-E3E75406A985}", sln.Result.ProjectItems.ElementAt(1).parent.Value?.header.pGuid);
+ Assert.Equal("subdir1", sln.Result.ProjectItems.ElementAt(1).parent.Value?.header.name);
- Assert.AreEqual(null, sln.Result.ProjectItems.ElementAt(2).parent.Value);
+ Assert.Null(sln.Result.ProjectItems.ElementAt(2).parent.Value);
- Assert.AreNotEqual(null, sln.Result.ProjectItems.ElementAt(3).parent.Value);
- Assert.AreEqual("{49B0FC00-2D07-419C-86D4-FDEC8BF0F12C}", sln.Result.ProjectItems.ElementAt(3).parent.Value?.header.pGuid);
- Assert.AreEqual("dir3", sln.Result.ProjectItems.ElementAt(3).parent.Value?.header.name);
+ Assert.NotNull(sln.Result.ProjectItems.ElementAt(3).parent.Value);
+ Assert.Equal("{49B0FC00-2D07-419C-86D4-FDEC8BF0F12C}", sln.Result.ProjectItems.ElementAt(3).parent.Value?.header.pGuid);
+ Assert.Equal("dir3", sln.Result.ProjectItems.ElementAt(3).parent.Value?.header.name);
- Assert.AreNotEqual(null, sln.Result.ProjectItems.ElementAt(4).parent.Value);
- Assert.AreEqual("{AB650B89-1B1B-43C6-B254-226B56ACB6EB}", sln.Result.ProjectItems.ElementAt(4).parent.Value?.header.pGuid);
- Assert.AreEqual("dir2", sln.Result.ProjectItems.ElementAt(4).parent.Value?.header.name);
+ Assert.NotNull(sln.Result.ProjectItems.ElementAt(4).parent.Value);
+ Assert.Equal("{AB650B89-1B1B-43C6-B254-226B56ACB6EB}", sln.Result.ProjectItems.ElementAt(4).parent.Value?.header.pGuid);
+ Assert.Equal("dir2", sln.Result.ProjectItems.ElementAt(4).parent.Value?.header.name);
}
}
- [TestMethod]
+ [Fact]
public void EnvTest1()
{
var projects = new Dictionary() {
@@ -372,114 +371,114 @@ public void EnvTest1()
{
IEnvironment env = sln.Result.Env;
- Assert.AreEqual(4, env.Projects.Count());
- Assert.AreEqual(1, env.UniqueByGuidProjects.Count());
+ Assert.Equal(4, env.Projects.Count());
+ Assert.Single(env.UniqueByGuidProjects);
- Assert.AreEqual("{12B25935-229F-4128-B66B-7561A77ABC54}", env.XProjectByGuid("{12B25935-229F-4128-B66B-7561A77ABC54}", new ConfigItem("Debug", "x86")).ProjectGuid);
- Assert.AreEqual(null, env.XProjectByGuid("none", new ConfigItem("Debug", "x86")));
- Assert.AreEqual(null, env.XProjectByGuid("{12B25935-229F-4128-B66B-7561A77ABC54}", null));
+ Assert.Equal("{12B25935-229F-4128-B66B-7561A77ABC54}", env.XProjectByGuid("{12B25935-229F-4128-B66B-7561A77ABC54}", new ConfigItem("Debug", "x86")).ProjectGuid);
+ Assert.Null(env.XProjectByGuid("none", new ConfigItem("Debug", "x86")));
+ Assert.Null(env.XProjectByGuid("{12B25935-229F-4128-B66B-7561A77ABC54}", null));
- Assert.AreEqual(0, env.XProjectsByGuid(null).Count());
+ Assert.Empty(env.XProjectsByGuid(null));
var xprojects = env.XProjectsByGuid("{12B25935-229F-4128-B66B-7561A77ABC54}");
- Assert.AreEqual(4, xprojects.Count());
- Assert.AreEqual("{12B25935-229F-4128-B66B-7561A77ABC54}", xprojects.ElementAt(0).ProjectGuid);
+ Assert.Equal(4, xprojects.Count());
+ Assert.Equal("{12B25935-229F-4128-B66B-7561A77ABC54}", xprojects.ElementAt(0).ProjectGuid);
}
}
- [TestMethod]
+ [Fact]
public void SlnItemsTest1()
{
using(var sln = new Sln(SlnItems.None, SlnSamplesResource.vsSolutionBuildEvent))
{
- Assert.AreEqual(null, sln.Result.DefaultConfig);
- Assert.AreEqual(null, sln.Result.Env);
- Assert.AreEqual(null, sln.Result.ProjectConfigs);
- Assert.AreEqual(null, sln.Result.ProjectConfigurationPlatforms);
- Assert.AreEqual(null, sln.Result.ProjectDependencies);
- Assert.AreEqual(null, sln.Result.ProjectItems);
- Assert.AreEqual(null, sln.Result.ProjectItemsConfigs);
- Assert.AreEqual(null, sln.Result.SolutionConfigs);
-
- Assert.AreNotEqual(null, sln.Result.Properties);
- Assert.AreEqual(SlnItems.None, sln.Result.ResultType);
+ Assert.Null(sln.Result.DefaultConfig);
+ Assert.Null(sln.Result.Env);
+ Assert.Null(sln.Result.ProjectConfigs);
+ Assert.Null(sln.Result.ProjectConfigurationPlatforms);
+ Assert.Null(sln.Result.ProjectDependencies);
+ Assert.Null(sln.Result.ProjectItems);
+ Assert.Null(sln.Result.ProjectItemsConfigs);
+ Assert.Null(sln.Result.SolutionConfigs);
+
+ Assert.NotNull(sln.Result.Properties);
+ Assert.Equal(SlnItems.None, sln.Result.ResultType);
}
}
- [TestMethod]
+ [Fact]
public void SlnItemsTest2()
{
using(var sln = new Sln(SlnItems.All &~ SlnItems.LoadDefaultData, SlnSamplesResource.vsSolutionBuildEvent))
{
- Assert.AreNotEqual(null, sln.Result.DefaultConfig);
- Assert.AreNotEqual(null, sln.Result.Env);
- Assert.AreNotEqual(null, sln.Result.ProjectConfigs);
- Assert.AreNotEqual(null, sln.Result.ProjectConfigurationPlatforms);
- Assert.AreNotEqual(null, sln.Result.ProjectDependencies);
- Assert.AreNotEqual(null, sln.Result.ProjectItems);
- Assert.AreNotEqual(null, sln.Result.ProjectItemsConfigs);
- Assert.AreNotEqual(null, sln.Result.SolutionConfigs);
- Assert.AreNotEqual(null, sln.Result.Properties);
-
- Assert.AreEqual(SlnItems.All & ~SlnItems.LoadDefaultData, sln.Result.ResultType);
+ Assert.NotNull(sln.Result.DefaultConfig);
+ Assert.NotNull(sln.Result.Env);
+ Assert.NotNull(sln.Result.ProjectConfigs);
+ Assert.NotNull(sln.Result.ProjectConfigurationPlatforms);
+ Assert.NotNull(sln.Result.ProjectDependencies);
+ Assert.NotNull(sln.Result.ProjectItems);
+ Assert.NotNull(sln.Result.ProjectItemsConfigs);
+ Assert.NotNull(sln.Result.SolutionConfigs);
+ Assert.NotNull(sln.Result.Properties);
+
+ Assert.Equal(SlnItems.All & ~SlnItems.LoadDefaultData, sln.Result.ResultType);
}
}
- [TestMethod]
+ [Fact]
public void MapTest1()
{
using(var sln = new Sln(SlnItems.All &~ SlnItems.LoadDefaultData, SlnSamplesResource.vsSolutionBuildEvent_map))
{
var map = sln.Result.Map;
- Assert.AreEqual(38, map.Count);
-
- Assert.AreEqual(typeof(LVisualStudioVersion), map[0].Handler.GetType());
-
- Assert.AreEqual(typeof(LProject), map[1].Handler.GetType());
- Assert.AreEqual(typeof(LProjectDependencies), map[2].Handler.GetType());
-
- Assert.AreEqual(typeof(LProject), map[3].Handler.GetType());
- Assert.AreEqual(typeof(LProjectDependencies), map[4].Handler.GetType());
- Assert.AreEqual(typeof(LProjectDependencies), map[5].Handler.GetType());
- Assert.AreEqual(typeof(LProjectDependencies), map[6].Handler.GetType());
- Assert.AreEqual(typeof(LProjectDependencies), map[7].Handler.GetType());
-
- Assert.AreEqual(typeof(LProjectSolutionItems), map[8].Handler.GetType());
- Assert.AreEqual(typeof(LProjectSolutionItems), map[9].Handler.GetType());
- Assert.AreEqual(typeof(LProjectSolutionItems), map[10].Handler.GetType());
- Assert.AreEqual(typeof(LProjectSolutionItems), map[11].Handler.GetType());
- Assert.AreEqual(typeof(LProjectSolutionItems), map[12].Handler.GetType());
- Assert.AreEqual(typeof(LProjectSolutionItems), map[13].Handler.GetType());
- Assert.AreEqual(typeof(LProjectSolutionItems), map[14].Handler.GetType());
-
- Assert.AreEqual(typeof(LProjectSolutionItems), map[15].Handler.GetType());
- Assert.AreEqual(typeof(LProjectSolutionItems), map[16].Handler.GetType());
- Assert.AreEqual(typeof(LProjectSolutionItems), map[17].Handler.GetType());
- Assert.AreEqual(typeof(LProjectSolutionItems), map[18].Handler.GetType());
- Assert.AreEqual(typeof(LProjectSolutionItems), map[19].Handler.GetType());
- Assert.AreEqual(typeof(LProjectSolutionItems), map[20].Handler.GetType());
-
- Assert.AreEqual(null, map[21].Handler);
-
- Assert.AreEqual(typeof(LSolutionConfigurationPlatforms), map[22].Handler.GetType());
- Assert.AreEqual(typeof(LSolutionConfigurationPlatforms), map[23].Handler.GetType());
- Assert.AreEqual(typeof(LSolutionConfigurationPlatforms), map[24].Handler.GetType());
- Assert.AreEqual(typeof(LSolutionConfigurationPlatforms), map[25].Handler.GetType());
- Assert.AreEqual(typeof(LSolutionConfigurationPlatforms), map[26].Handler.GetType());
-
- Assert.AreEqual(typeof(LProjectConfigurationPlatforms), map[27].Handler.GetType());
- Assert.AreEqual(typeof(LProjectConfigurationPlatforms), map[28].Handler.GetType());
- Assert.AreEqual(typeof(LProjectConfigurationPlatforms), map[29].Handler.GetType());
- Assert.AreEqual(typeof(LProjectConfigurationPlatforms), map[30].Handler.GetType());
- Assert.AreEqual(typeof(LProjectConfigurationPlatforms), map[31].Handler.GetType());
-
- Assert.AreEqual(null, map[32].Handler);
- Assert.AreEqual(null, map[33].Handler);
- Assert.AreEqual(null, map[34].Handler);
- Assert.AreEqual(null, map[35].Handler);
-
- Assert.AreEqual(typeof(LProject), map[36].Handler.GetType());
- Assert.AreEqual(typeof(LProjectDependencies), map[37].Handler.GetType());
+ Assert.Equal(38, map.Count);
+
+ Assert.Equal(typeof(LVisualStudioVersion), map[0].Handler.GetType());
+
+ Assert.Equal(typeof(LProject), map[1].Handler.GetType());
+ Assert.Equal(typeof(LProjectDependencies), map[2].Handler.GetType());
+
+ Assert.Equal(typeof(LProject), map[3].Handler.GetType());
+ Assert.Equal(typeof(LProjectDependencies), map[4].Handler.GetType());
+ Assert.Equal(typeof(LProjectDependencies), map[5].Handler.GetType());
+ Assert.Equal(typeof(LProjectDependencies), map[6].Handler.GetType());
+ Assert.Equal(typeof(LProjectDependencies), map[7].Handler.GetType());
+
+ Assert.Equal(typeof(LProjectSolutionItems), map[8].Handler.GetType());
+ Assert.Equal(typeof(LProjectSolutionItems), map[9].Handler.GetType());
+ Assert.Equal(typeof(LProjectSolutionItems), map[10].Handler.GetType());
+ Assert.Equal(typeof(LProjectSolutionItems), map[11].Handler.GetType());
+ Assert.Equal(typeof(LProjectSolutionItems), map[12].Handler.GetType());
+ Assert.Equal(typeof(LProjectSolutionItems), map[13].Handler.GetType());
+ Assert.Equal(typeof(LProjectSolutionItems), map[14].Handler.GetType());
+
+ Assert.Equal(typeof(LProjectSolutionItems), map[15].Handler.GetType());
+ Assert.Equal(typeof(LProjectSolutionItems), map[16].Handler.GetType());
+ Assert.Equal(typeof(LProjectSolutionItems), map[17].Handler.GetType());
+ Assert.Equal(typeof(LProjectSolutionItems), map[18].Handler.GetType());
+ Assert.Equal(typeof(LProjectSolutionItems), map[19].Handler.GetType());
+ Assert.Equal(typeof(LProjectSolutionItems), map[20].Handler.GetType());
+
+ Assert.Null(map[21].Handler);
+
+ Assert.Equal(typeof(LSolutionConfigurationPlatforms), map[22].Handler.GetType());
+ Assert.Equal(typeof(LSolutionConfigurationPlatforms), map[23].Handler.GetType());
+ Assert.Equal(typeof(LSolutionConfigurationPlatforms), map[24].Handler.GetType());
+ Assert.Equal(typeof(LSolutionConfigurationPlatforms), map[25].Handler.GetType());
+ Assert.Equal(typeof(LSolutionConfigurationPlatforms), map[26].Handler.GetType());
+
+ Assert.Equal(typeof(LProjectConfigurationPlatforms), map[27].Handler.GetType());
+ Assert.Equal(typeof(LProjectConfigurationPlatforms), map[28].Handler.GetType());
+ Assert.Equal(typeof(LProjectConfigurationPlatforms), map[29].Handler.GetType());
+ Assert.Equal(typeof(LProjectConfigurationPlatforms), map[30].Handler.GetType());
+ Assert.Equal(typeof(LProjectConfigurationPlatforms), map[31].Handler.GetType());
+
+ Assert.Null(map[32].Handler);
+ Assert.Null(map[33].Handler);
+ Assert.Null(map[34].Handler);
+ Assert.Null(map[35].Handler);
+
+ Assert.Equal(typeof(LProject), map[36].Handler.GetType());
+ Assert.Equal(typeof(LProjectDependencies), map[37].Handler.GetType());
}
}
}
diff --git a/MvsSlnTest/packages.config b/MvsSlnTest/packages.config
deleted file mode 100644
index 06aa648..0000000
--- a/MvsSlnTest/packages.config
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file