Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyrrrz committed May 23, 2024
1 parent 0b5cd5b commit 46006a0
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 6 deletions.
31 changes: 26 additions & 5 deletions Onova.Tests/UpdateSpecs.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
using FluentAssertions;
Expand Down Expand Up @@ -45,7 +46,11 @@ public void Dispose()
public async Task I_can_check_for_updates_and_get_a_higher_version_if_it_is_available()
{
// Arrange
var updatee = new AssemblyMetadata("TestUpdatee", Version.Parse("1.0"), "");
var updatee = new AssemblyMetadata(
"TestUpdatee",
Version.Parse("1.0"),
Assembly.GetExecutingAssembly().Location
);

// Cleanup storage directory (TODO: move this to API)
DirectoryEx.DeleteIfExists(
Expand Down Expand Up @@ -82,7 +87,11 @@ public async Task I_can_check_for_updates_and_get_a_higher_version_if_it_is_avai
public async Task I_can_check_for_updates_and_get_nothing_if_there_is_no_higher_version_available()
{
// Arrange
var updatee = new AssemblyMetadata("TestUpdatee", Version.Parse("3.0"), "");
var updatee = new AssemblyMetadata(
"TestUpdatee",
Version.Parse("3.0"),
Assembly.GetExecutingAssembly().Location
);

// Cleanup storage directory (TODO: move this to API)
DirectoryEx.DeleteIfExists(
Expand Down Expand Up @@ -119,7 +128,11 @@ public async Task I_can_check_for_updates_and_get_nothing_if_there_is_no_higher_
public async Task I_can_check_for_updates_and_get_nothing_if_the_package_source_contains_no_packages()
{
// Arrange
var updatee = new AssemblyMetadata("TestUpdatee", Version.Parse("1.0"), "");
var updatee = new AssemblyMetadata(
"TestUpdatee",
Version.Parse("1.0"),
Assembly.GetExecutingAssembly().Location
);

// Cleanup storage directory (TODO: move this to API)
DirectoryEx.DeleteIfExists(
Expand Down Expand Up @@ -151,7 +164,11 @@ public async Task I_can_check_for_updates_and_get_nothing_if_the_package_source_
public async Task I_can_prepare_an_update_so_that_it_can_be_installed()
{
// Arrange
var updatee = new AssemblyMetadata("TestUpdatee", Version.Parse("1.0"), "");
var updatee = new AssemblyMetadata(
"TestUpdatee",
Version.Parse("1.0"),
Assembly.GetExecutingAssembly().Location
);

// Cleanup storage directory (TODO: move this to API)
DirectoryEx.DeleteIfExists(
Expand Down Expand Up @@ -188,7 +205,11 @@ public async Task I_can_prepare_an_update_so_that_it_can_be_installed()
public async Task I_can_get_a_list_of_updates_which_are_already_prepared_to_install()
{
// Arrange
var updatee = new AssemblyMetadata("TestUpdatee", Version.Parse("1.0"), "");
var updatee = new AssemblyMetadata(
"TestUpdatee",
Version.Parse("1.0"),
Assembly.GetExecutingAssembly().Location
);

// Cleanup storage directory (TODO: move this to API)
DirectoryEx.DeleteIfExists(
Expand Down
4 changes: 3 additions & 1 deletion Onova/Models/AssemblyMetadata.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ public static AssemblyMetadata FromAssembly(Assembly assembly, string assemblyFi
/// <summary>
/// Extracts assembly metadata from the specified assembly.
/// </summary>
[RequiresAssemblyFiles("This method requires the specified assembly's file path to be available.")]
[RequiresAssemblyFiles(
"This method requires the specified assembly's file path to be available."
)]
public static AssemblyMetadata FromAssembly(Assembly assembly)
{
if (string.IsNullOrEmpty(assembly.Location))
Expand Down

0 comments on commit 46006a0

Please sign in to comment.