Skip to content

Commit

Permalink
build(deps): bump MSTest.TestFramework from 3.6.4 to 3.7.0 (#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
BoBoBaSs84 authored Dec 22, 2024
2 parents 308fcd9 + 2d3282a commit 284fd46
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 31 deletions.
4 changes: 2 additions & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<PackageVersion Include="BB84.Extensions" Version="2.8.1216" />
<PackageVersion Include="BCnEncoder.Net" Version="2.1.0" />
<PackageVersion Include="BCnEncoder.Net.ImageSharp" Version="1.1.1" />
<PackageVersion Include="MSTest.TestAdapter" Version="3.6.4" />
<PackageVersion Include="MSTest.TestFramework" Version="3.6.4" />
<PackageVersion Include="MSTest.TestAdapter" Version="3.7.0" />
<PackageVersion Include="MSTest.TestFramework" Version="3.7.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="9.0.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageVersion Include="SixLabors.ImageSharp" Version="3.1.6" />
Expand Down
5 changes: 1 addition & 4 deletions tests/DDS.ToolsTests/Models/DdsImageModelTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@ public class DdsImageModelTests : UnitTestBase
private static readonly string NewFilePath = Path.Combine(TestConstants.ResourcePath, "new_32a.png");

[TestCleanup]
public override void TestCleanup()
public void TestCleanup()
{
if (File.Exists(NewFilePath))
File.Delete(NewFilePath);

base.TestCleanup();
}

[TestMethod]
Expand All @@ -27,7 +25,6 @@ public void LoadTest()

image.Load(FilePath);

Assert.IsNotNull(image);
Assert.AreNotEqual(string.Empty, image.Name);
Assert.AreNotEqual(string.Empty, image.Path);
Assert.AreNotEqual(0, image.Width);
Expand Down
5 changes: 1 addition & 4 deletions tests/DDS.ToolsTests/Models/PngImageModelTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,10 @@ public sealed class PngImageModelTests : UnitTestBase
private static readonly string NewFilePath = Path.Combine(TestConstants.ResourcePath, "new_32.dds");

[TestCleanup]
public override void TestCleanup()
public void TestCleanup()
{
if (File.Exists(NewFilePath))
File.Delete(NewFilePath);

base.TestCleanup();
}

[TestMethod]
Expand All @@ -27,7 +25,6 @@ public void LoadTest()

image.Load(FilePath);

Assert.IsNotNull(image);
Assert.AreNotEqual(string.Empty, image.Name);
Assert.AreNotEqual(string.Empty, image.Path);
Assert.AreNotEqual(0, image.Width);
Expand Down
5 changes: 2 additions & 3 deletions tests/DDS.ToolsTests/Services/TodoServiceTests.GetTodos.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace DDS.ToolsTests.Services;
public sealed partial class TodoServiceTests
{
[DataTestMethod]
[DynamicData(nameof(GetTodosData))]
[DynamicData(nameof(GetTodosData), DynamicDataSourceType.Property)]
public void GetTodosTest(string resourcePath, ImageType type, int expected)
{
DdsConvertSettings settings = new() { SourceFolder = resourcePath, TargetFolder = resourcePath };
Expand All @@ -19,7 +19,6 @@ public void GetTodosTest(string resourcePath, ImageType type, int expected)
}

[TestMethod]
[ExpectedException(typeof(ServiceException))]
public void GetTodosSourceFolderNotFoundTest()
=> s_todoService.GetTodos(new DdsConvertSettings() { SourceFolder = @"X:\FooBar" }, ImageType.DDS);
=> Assert.ThrowsException<ServiceException>(() => s_todoService.GetTodos(new DdsConvertSettings() { SourceFolder = @"X:\FooBar" }, ImageType.DDS));
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ namespace DDS.ToolsTests.Services;
public sealed partial class TodoServiceTests
{
[TestMethod]
[ExpectedException(typeof(ServiceException))]
public void GetTodosDoneExceptionTest()
=> s_todoService.GetTodosDone(null!, null!, ImageType.DDS);
=> Assert.ThrowsException<ServiceException>(() => s_todoService.GetTodosDone(null!, null!, ImageType.DDS));

[TestMethod]
public void GetTodosDoneTest()
Expand Down
11 changes: 6 additions & 5 deletions tests/DDS.ToolsTests/Services/TodoServiceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ public static void ClassInitialize(TestContext context)
=> s_todoService = ServiceProvider.GetRequiredService<ITodoService>();

private static IEnumerable<object[]> GetTodosData
=> new object[][]{
[TestConstants.PngResourcePath, ImageType.PNG, 6],
[TestConstants.PngResourcePath, ImageType.DDS, 0],
[TestConstants.DdsResourcePath, ImageType.DDS, 6],
[TestConstants.DdsResourcePath, ImageType.PNG, 0]
=> new object[][]
{
[TestConstants.PngResourcePath, ImageType.PNG, 6],
[TestConstants.PngResourcePath, ImageType.DDS, 0],
[TestConstants.DdsResourcePath, ImageType.DDS, 6],
[TestConstants.DdsResourcePath, ImageType.PNG, 0]
};
}
11 changes: 0 additions & 11 deletions tests/DDS.ToolsTests/UnitTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,13 @@ namespace DDS.ToolsTests;
[TestClass]
public abstract class UnitTestBase
{
private static TestContext? s_context;

[AssemblyInitialize]
public static void AssemblyInitialize(TestContext context)
{
s_context = context;
IHost host = CreateTestHost();
ServiceProvider = host.Services;
}

[TestInitialize]
public virtual void TestInitialize()
=> s_context?.WriteLine($"Initialize {s_context.TestName} ..");

[TestCleanup]
public virtual void TestCleanup()
=> s_context?.WriteLine($"Cleanup {s_context.TestName} ..");

public static IServiceProvider ServiceProvider { get; private set; } = default!;

private static IHost CreateTestHost()
Expand Down

0 comments on commit 284fd46

Please sign in to comment.