Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRAFT testrunner #2988

Draft
wants to merge 28 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
3389c64
feat(MsTestSample): Add sample project using new SDK
MarcZw May 7, 2024
b1d6d42
Feat(all): Abstracting every aspect a testrunner needs to know about …
May 16, 2024
3045f26
Merge branch 'master' into feat/mstestrunner
May 16, 2024
fdd587f
Chore(Unittests): Update unit tests to new structure
May 19, 2024
4dbbaae
Fix(Unittests): Fix broken unittests
May 19, 2024
8a79c8f
Chore(New projects): Clean up folders
May 19, 2024
cc470ec
Chore(CsProj): Project clean up
May 19, 2024
9d3d59b
Fix(Unittests): Fix unittests dependend on file-scoped namespaces
May 21, 2024
6a03394
Fix(TestGuidsList): Null initializer
May 21, 2024
a1165c0
Fix(Unittests): fix for strict mocking behavior
May 21, 2024
1d020a7
Feat(Core/Shared): More abstracting
May 22, 2024
97d5f66
Fix(TestIdentifiers): Boolean expression
May 22, 2024
e4c1b6f
Merge branch 'master' into feat/mstestrunner
May 22, 2024
fa6c8f4
Chore(Not touched): Undo filescope namespaces
May 22, 2024
0f833b8
Feat(Integrationtests): Fix integration tests
May 22, 2024
7e2a4ed
Merge branch 'feat/mstestrunner' into feat/testrunner
May 23, 2024
d494db1
Feat(MsTestRunner): Add functionality to MsTestRunner
Jun 12, 2024
07d9c1b
Feat(MsTestRunner): Add support for a coverage run
Jun 12, 2024
1eac878
Feat(MsTestRunner): add explicit conversion and test coverage
Jun 13, 2024
b2dbd19
Feat(MstestRunner): Dashboard updates
Jun 14, 2024
e75e8cb
Fix(UnitTests): Fixed broken unittests
Jun 15, 2024
1473b9d
Feat(CLI): Add cli support and last bug fixes
Jun 15, 2024
d17fc2a
Fix(MsTestRunner): Use mstestrunner when chosen by the CLI
Jun 15, 2024
18af450
Feat(MsTestRunner): Add assembly caching
Jun 15, 2024
def633f
Feat(Settings): Load settingsfile dynamically
Jun 15, 2024
705dca6
Chore(MSTestRunner): Cleanup
Jun 16, 2024
8915247
Fix(MsTestProject): no console
Jun 16, 2024
d3cff70
Feat(Testrunner): Add optimizations
Jul 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 6 additions & 0 deletions ExampleProjects/MsTestSample/MsTestSample.Library/Class1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace MsTestSample.Library;

public class Class1
{

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
global using Microsoft.VisualStudio.TestTools.UnitTesting;
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project Sdk="MSTest.Sdk/3.3.1">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\MsTestSample.Project\MsTestSample.Project.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
namespace MsTestSample.Project.Unittests;

[TestClass]
public class PersonTests
{
[TestMethod]
[DataRow(10, 11)]
[DataRow(12, 13)]
[DataRow(13, 14)]
public void PersonCanAge(int ageA, int ageB)
{
var person = new Person() { Age = ageA };
var olderPerson = new Person() { Age = ageB };

Person.Aged(person);
Assert.IsTrue(person.SameAge(olderPerson));
}

[TestMethod]
public void UseEmbeddedResources()
{
var person = new Person() { Age = 10 };
Assert.AreEqual(person.HelloInMyLanguage(), "hello you");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<Compile Update="Translations.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Translations.resx</DependentUpon>
</Compile>
</ItemGroup>

<ItemGroup>
<EmbeddedResource Update="Translations.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Translations.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>

</Project>
33 changes: 33 additions & 0 deletions ExampleProjects/MsTestSample/MsTestSample.Project/Person.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
namespace MsTestSample.Project;

public class Person
{
public int Age { get; set; }

public bool Older(Person otherPerson) => Age > otherPerson.Age;

public bool Younger(Person otherPerson) => Age < otherPerson.Age;

public bool SameAge(Person otherPerson) => Age == otherPerson.Age;

public string HelloInMyLanguage() => Translations.hello + (Age > 16 ? " friend" : " you");

public static void Aged(Person person)
{
if (person.Age > 0)
{
person.Age++;
}
}

public static IEnumerable<Person> People
{
get
{
for (var i = 0; i < 10; i++)
{
yield return new Person { Age = i };
}
}
}
}
2 changes: 2 additions & 0 deletions ExampleProjects/MsTestSample/MsTestSample.Project/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// See https://aka.ms/new-console-template for more information
Console.WriteLine("Hello, World!");

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

123 changes: 123 additions & 0 deletions ExampleProjects/MsTestSample/MsTestSample.Project/Translations.resx
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema

Version 2.0

The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.

Example:

... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>

There are any number of "resheader" rows that contain simple
name/value pairs.

Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.

The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:

Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.

mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.

mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.

mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="hello" xml:space="preserve">
<value>hello</value>
</data>
</root>
34 changes: 34 additions & 0 deletions ExampleProjects/MsTestSample/MsTestSample.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MsTestSample.Library", "MsTestSample.Library\MsTestSample.Library.csproj", "{B0F3F857-59A2-4A3A-BC5C-4727F75030FE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MsTestSample.Project", "MsTestSample.Project\MsTestSample.Project.csproj", "{1D3535E6-6BA3-45B1-AC9F-003601A10F51}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MsTestSample.Project.Unittests", "MsTestSample.Project.Unittests\MsTestSample.Project.Unittests.csproj", "{3AE91D07-51A0-4FF8-A0C7-70A77F1E6990}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B0F3F857-59A2-4A3A-BC5C-4727F75030FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B0F3F857-59A2-4A3A-BC5C-4727F75030FE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B0F3F857-59A2-4A3A-BC5C-4727F75030FE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B0F3F857-59A2-4A3A-BC5C-4727F75030FE}.Release|Any CPU.Build.0 = Release|Any CPU
{1D3535E6-6BA3-45B1-AC9F-003601A10F51}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1D3535E6-6BA3-45B1-AC9F-003601A10F51}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1D3535E6-6BA3-45B1-AC9F-003601A10F51}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1D3535E6-6BA3-45B1-AC9F-003601A10F51}.Release|Any CPU.Build.0 = Release|Any CPU
{3AE91D07-51A0-4FF8-A0C7-70A77F1E6990}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3AE91D07-51A0-4FF8-A0C7-70A77F1E6990}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3AE91D07-51A0-4FF8-A0C7-70A77F1E6990}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3AE91D07-51A0-4FF8-A0C7-70A77F1E6990}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"net6.0": {
"FSharp.Core": {
"type": "Direct",
"requested": "[8.0.300, )",
"resolved": "8.0.300",
"contentHash": "Jv44fV7TNglyMku89lQcA4Q6mFKLyHb2bs1Yb72nvSVc+cHplEnoZ4XQUaaTLJGUTx/iMqcrkYGtaLzkkIhpaA=="
"requested": "[8.0.200, )",
"resolved": "8.0.200",
"contentHash": "qnxoF3Fu0HzfOeYdrwmQOsLP1v+OtOMSIYkNVUwf6nGqWzL03Hh4r6VFCvCb54jlsgtt3WADVYkKkrgdeY5kiQ=="
},
"Microsoft.NET.Test.Sdk": {
"type": "Direct",
Expand Down Expand Up @@ -110,7 +110,7 @@
"library.fsharp": {
"type": "Project",
"dependencies": {
"FSharp.Core": "[8.0.300, )"
"FSharp.Core": "[8.0.200, )"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"net6.0": {
"FSharp.Core": {
"type": "Direct",
"requested": "[8.0.300, )",
"resolved": "8.0.300",
"contentHash": "Jv44fV7TNglyMku89lQcA4Q6mFKLyHb2bs1Yb72nvSVc+cHplEnoZ4XQUaaTLJGUTx/iMqcrkYGtaLzkkIhpaA=="
"requested": "[8.0.200, )",
"resolved": "8.0.200",
"contentHash": "qnxoF3Fu0HzfOeYdrwmQOsLP1v+OtOMSIYkNVUwf6nGqWzL03Hh4r6VFCvCb54jlsgtt3WADVYkKkrgdeY5kiQ=="
}
}
}
Expand Down
Loading