-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmstest2xunit.ps1
21 lines (21 loc) · 1015 Bytes
/
mstest2xunit.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Param(
[string]$ProjectDir
)
get-childitem $ProjectDir -recurse -include *.cs |
select -expand fullname |
foreach {
(Get-Content $_) -replace '\[TestMethod\]','[Fact]' `
-replace 'Assert.AreEqual' , 'Assert.Equal' `
-replace 'Assert.AreNotEqual' , 'Assert.NotEqual' `
-replace 'Assert.IsTrue' , 'Assert.True' `
-replace 'Assert.IsFalse' , 'Assert.False' `
-replace 'Assert.IsNotNull' , 'Assert.NotNull' `
-replace 'Assert.IsNull' , 'Assert.Null' `
-replace '\[TestClass\]' , ' ' `
-replace 'Assert.AreNotSame' , 'Assert.NotSame' `
-replace 'Assert.AreSame' , 'Assert.NotSame' `
-replace 'Assert.IsInstanceOfType' , 'Assert.IsType' `
-replace 'Assert.IsNotInstanceOfType' , 'Assert.IsNotType' `
-replace 'using Microsoft.VisualStudio.TestTools.UnitTesting' , 'using Xunit' `
| Set-Content -Encoding utf8 $_
}