Skip to content

Commit c1fd2f0

Browse files
add support for mstest and xunit
1 parent bf986a7 commit c1fd2f0

15 files changed

+241
-9
lines changed

Testimize.Tests/RealWorldExamples/ExploratoryModeCountriesGraphQLTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
using RestSharp;
1616
using System;
1717
using System.Collections.Generic;
18+
using Testimize.NUnit;
1819
using Testimize.Parameters.Core;
1920
using Testimize.OutputGenerators;
2021
using Testimize.Usage;

Testimize.Tests/RealWorldExamples/JsonPlaceholderPostTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
using System;
1717
using System.Collections.Generic;
1818
using Testimize.Contracts;
19+
using Testimize.NUnit;
1920
using Testimize.Parameters.Core;
2021
using Testimize.OutputGenerators;
2122
using Testimize.Usage;
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
// <copyright file="SampleMSTestTests.cs" company="Automate The Planet Ltd.">
2+
// Copyright 2025 Automate The Planet Ltd.
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// You may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
6+
// Unless required by applicable law or agreed to in writing,
7+
// software distributed under the License is distributed on an "AS IS" BASIS,
8+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9+
// See the License for the specific language governing permissions and
10+
// limitations under the License.
11+
// </copyright>
12+
// <author>Anton Angelov</author>
13+
// <site>https://automatetheplanet.com/</site>
14+
15+
using System.Collections.Generic;
16+
using Testimize.Parameters;
17+
using System.Diagnostics;
18+
using Testimize.Contracts;
19+
using Testimize.MSTest;
20+
using Testimize.OutputGenerators;
21+
using Testimize.Parameters.Core;
22+
using Testimize.Usage;
23+
using MS = Microsoft.VisualStudio.TestTools.UnitTesting;
24+
using System;
25+
26+
namespace Testimize.Tests.RealWorldExamples.MSTest;
27+
28+
[MS.TestClass]
29+
public class SampleMSTestTests
30+
{
31+
public static List<TestCase> ConfigureEngine() =>
32+
TestimizeEngine.Configure(
33+
parameters => parameters
34+
.AddText(6, 12)
35+
.AddEmail(5, 10)
36+
.AddPhone(6, 8)
37+
.AddText(4, 10)
38+
, settings =>
39+
{
40+
settings.Mode = TestGenerationMode.HybridArtificialBeeColony;
41+
settings.TestCaseCategory = TestCaseCategory.Validation;
42+
}
43+
).Generate();
44+
45+
[MS.DataTestMethod]
46+
[TestimizeGeneratedTestCases(nameof(ConfigureEngine))]
47+
[Category(Categories.CI)]
48+
public void ValidateInputs(string textValue, string email, string phone, string anotherText)
49+
{
50+
MS.Assert.IsNotNull(textValue);
51+
MS.Assert.IsNotNull(email);
52+
MS.Assert.IsNotNull(phone);
53+
MS.Assert.IsNotNull(anotherText);
54+
55+
Debug.WriteLine($"Running test with: {textValue}, {email}, {phone}, {anotherText}");
56+
}
57+
}

Testimize.Tests/RealWorldExamples/SampleSecondVerTests.cs renamed to Testimize.Tests/RealWorldExamples/NUnit/SampleNUnitTests.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// <copyright file="SampleTests.cs" company="Automate The Planet Ltd.">
1+
// <copyright file="SampleMSTestTests.cs" company="Automate The Planet Ltd.">
22
// Copyright 2025 Automate The Planet Ltd.
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// You may not use this file except in compliance with the License.
@@ -16,18 +16,19 @@
1616
using Testimize.Parameters;
1717
using System.Diagnostics;
1818
using Testimize.Contracts;
19+
using Testimize.NUnit;
1920
using Testimize.OutputGenerators;
2021
using Testimize.Parameters.Core;
2122
using Testimize.Usage;
2223

23-
namespace Testimize.Tests.RealWorldExamples;
24+
namespace Testimize.Tests.RealWorldExamples.NUnit;
2425

2526
//new TextDataParameter(minBoundary: 6, maxBoundary: 12),
2627
//new EmailDataParameter(minBoundary: 5, maxBoundary: 10),
2728
//new PhoneDataParameter(minBoundary: 6, maxBoundary: 8),
2829
//new TextDataParameter(minBoundary: 4, maxBoundary: 10),
2930
[TestFixture]
30-
public class SampleSecondVerTests
31+
public class SampleNUnitTests
3132
{
3233
public static List<TestCase> ConfigureEngine() =>
3334
TestimizeEngine.Configure(
@@ -44,6 +45,7 @@ public static List<TestCase> ConfigureEngine() =>
4445
).Generate();
4546

4647
[Test, TestimizeGeneratedTestCases(nameof(ConfigureEngine))]
48+
[Category(Categories.CI)]
4749
public void TestABCGeneration(string textValue, string email, string phone, string anotherText)
4850
{
4951
Debug.WriteLine($"Running test with: {textValue}, {email}, {phone}, {anotherText}");

Testimize.Tests/RealWorldExamples/SampleTests.cs renamed to Testimize.Tests/RealWorldExamples/NUnit/SampleTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// <copyright file="SampleTests.cs" company="Automate The Planet Ltd.">
1+
// <copyright file="SampleMSTestTests.cs" company="Automate The Planet Ltd.">
22
// Copyright 2025 Automate The Planet Ltd.
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// You may not use this file except in compliance with the License.
@@ -18,7 +18,7 @@
1818
using Testimize.Contracts;
1919
using Testimize.OutputGenerators;
2020

21-
namespace Testimize.Tests.RealWorldExamples;
21+
namespace Testimize.Tests.RealWorldExamples.NUnit;
2222

2323
[TestFixture]
2424
public class SampleTests

Testimize.Tests/RealWorldExamples/ReqresRegistrationTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
using System;
1616
using System.Collections.Generic;
1717
using RestSharp;
18+
using Testimize.NUnit;
1819
using Testimize.OutputGenerators;
1920
using Testimize.Parameters.Core;
2021
using Testimize.Usage;
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
// <copyright file="SampleXUnitTests.cs" company="Automate The Planet Ltd.">
2+
// Copyright 2025 Automate The Planet Ltd.
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// You may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
6+
// Unless required by applicable law or agreed to in writing,
7+
// software distributed under the License is distributed on an "AS IS" BASIS,
8+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9+
// See the License for the specific language governing permissions and
10+
// limitations under the License.
11+
// </copyright>
12+
// <author>Anton Angelov</author>
13+
// <site>https://automatetheplanet.com/</site>
14+
15+
using System.Collections.Generic;
16+
using Testimize.OutputGenerators;
17+
using Testimize.Parameters.Core;
18+
using Testimize.Usage;
19+
using System;
20+
using Testimize.Xunit;
21+
using Xunit.Sdk;
22+
using System.Diagnostics;
23+
24+
namespace Testimize.Tests.RealWorldExamples.Xunit;
25+
26+
public class SampleXUnitTests
27+
{
28+
public static List<TestCase> ConfigureEngine() =>
29+
TestimizeEngine.Configure(
30+
parameters => parameters
31+
.AddText(6, 12)
32+
.AddEmail(5, 10)
33+
.AddPhone(6, 8)
34+
.AddText(4, 10)
35+
, settings =>
36+
{
37+
settings.Mode = TestGenerationMode.HybridArtificialBeeColony;
38+
settings.TestCaseCategory = TestCaseCategory.Validation;
39+
}
40+
).Generate();
41+
42+
43+
[Category(Categories.CI)]
44+
[Theory]
45+
[TestimizeGeneratedTestCases(nameof(ConfigureEngine))]
46+
public void ValidateInputs(string textValue, string email, string phone, string anotherText)
47+
{
48+
Debug.WriteLine($"Running test with: {textValue}, {email}, {phone}, {anotherText}");
49+
50+
Assert.That(textValue, Is.Not.Null);
51+
Assert.That(email, Is.Not.Null);
52+
Assert.That(phone, Is.Not.Null);
53+
Assert.That(anotherText, Is.Not.Null);
54+
}
55+
}

Testimize.Tests/Testimize.Tests.csproj

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,20 @@
2727
<Description>Testimize is a smart and scalable test data generation engine for .NET. It supports boundary value analysis, pairwise testing, and heuristic optimization via the Artificial Bee Colony (ABC) algorithm. Designed for CI/CD, exploratory testing, and validation scenarios.</Description>
2828
</PropertyGroup>
2929
<ItemGroup>
30-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
30+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
31+
<PackageReference Include="MSTest.TestAdapter" Version="3.8.3" />
32+
<PackageReference Include="MSTest.TestFramework" Version="3.8.3" />
3133
<PackageReference Include="NUnit" Version="4.3.2" />
3234
<PackageReference Include="NUnit.Analyzers" Version="4.6.0" />
3335
<PackageReference Include="NUnit3TestAdapter" Version="5.0.0" />
3436
<PackageReference Include="RestSharp" Version="112.1.0" />
3537
<PackageReference Include="Selenium.Support" Version="4.30.0" />
3638
<PackageReference Include="Selenium.WebDriver" Version="4.30.0" />
39+
<PackageReference Include="xunit" Version="2.9.3" />
40+
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.2">
41+
<PrivateAssets>all</PrivateAssets>
42+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
43+
</PackageReference>
3744
</ItemGroup>
3845

3946
<ItemGroup>

Testimize/Testimize.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,13 @@
4747

4848
<ItemGroup>
4949
<PackageReference Include="Bogus" Version="35.6.2" />
50+
<PackageReference Include="MSTest.TestFramework" Version="3.8.3" />
5051
<PackageReference Include="TextCopy" Version="6.2.1" />
5152
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="9.0.2" />
5253
<PackageReference Include="Microsoft.Extensions.Configuration" Version="9.0.2" />
5354
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="9.0.2" />
5455
<PackageReference Include="NUnit" Version="4.3.2" />
56+
<PackageReference Include="xunit" Version="2.9.3" />
5557
</ItemGroup>
5658

5759
<ItemGroup>

Testimize/samples/ExploratoryModeCountriesGraphQLTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
using System.Collections.Generic;
1717
using NUnit.Framework;
1818
using Testimize.Contracts;
19+
using Testimize.NUnit;
1920
using Testimize.OutputGenerators;
2021
using Testimize.Parameters.Core;
2122
using Testimize.Usage;

0 commit comments

Comments
 (0)