Skip to content

Commit

Permalink
Merge pull request #73 from LuxoriaSoft/fix/cicd/tests-coverage
Browse files Browse the repository at this point in the history
fix: Excluding events and some basic models from coverage
  • Loading branch information
QuentinCraft authored Dec 6, 2024
2 parents 056b85f + 6ea94b0 commit a62af85
Show file tree
Hide file tree
Showing 12 changed files with 152 additions and 157 deletions.
4 changes: 0 additions & 4 deletions Luxoria.App/Luxoria.Modules/EventBus.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using Luxoria.Modules.Interfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Luxoria.Modules
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Diagnostics.CodeAnalysis;

namespace Luxoria.Modules.Models.Events
{
[ExcludeFromCodeCoverage]
public class CollectionUpdatedEvent
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
using System;
using System.Diagnostics.CodeAnalysis;

namespace Luxoria.Modules.Models.Events
{
[ExcludeFromCodeCoverage]
public class ImageUpdatedEvent
{
public string ImagePath { get; }
Expand Down
5 changes: 4 additions & 1 deletion Luxoria.App/Luxoria.Modules/Models/Events/LogEvent.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
namespace Luxoria.Modules.Models.Events
using System.Diagnostics.CodeAnalysis;

namespace Luxoria.Modules.Models.Events
{
[ExcludeFromCodeCoverage]
public class LogEvent
{
public string Message { get; }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
namespace Luxoria.Modules.Models.Events;
using System.Diagnostics.CodeAnalysis;

namespace Luxoria.Modules.Models.Events;

/// <summary>
/// Represents an event triggered when a collection is opened.
/// </summary>
[ExcludeFromCodeCoverage]
public class OpenCollectionEvent
{
// *** Properties ***
Expand Down
3 changes: 2 additions & 1 deletion Luxoria.App/Luxoria.Modules/Models/Events/TextInputEvent.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
using System;
using System.Diagnostics.CodeAnalysis;

namespace Luxoria.Modules.Models.Events
{
[ExcludeFromCodeCoverage]
public class TextInputEvent
{
public string Text { get; }
Expand Down
8 changes: 1 addition & 7 deletions Luxoria.App/Luxoria.Modules/Models/FileExtension.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Luxoria.Modules.Models
namespace Luxoria.Modules.Models
{
/// <summary>
/// Represents a file extension.
Expand Down
70 changes: 36 additions & 34 deletions Luxoria.App/Luxoria.Modules/Models/LuxAction.cs
Original file line number Diff line number Diff line change
@@ -1,43 +1,45 @@
namespace Luxoria.Modules.Models
using System.Diagnostics.CodeAnalysis;

namespace Luxoria.Modules.Models;

/// <summary>
/// Represents an action associated with a tool in the Luxoria application.
/// </summary>
[ExcludeFromCodeCoverage]
public class LuxAction
{
/// <summary>
/// Represents an action associated with a tool in the Luxoria application.
/// Gets the unique identifier for the action.
/// </summary>
public class LuxAction
{
/// <summary>
/// Gets the unique identifier for the action.
/// </summary>
public Guid Id { get; private set; }
public Guid Id { get; private set; }

/// <summary>
/// Gets the unique identifier for the associated tool.
/// </summary>
public Guid ToolId { get; private set; }
/// <summary>
/// Gets the unique identifier for the associated tool.
/// </summary>
public Guid ToolId { get; private set; }

/// <summary>
/// Gets the parameters associated with the action.
/// </summary>
public List<string> Parameters { get; private set; }
/// <summary>
/// Gets the parameters associated with the action.
/// </summary>
public List<string> Parameters { get; private set; }

/// <summary>
/// Gets the arguments associated with the action.
/// </summary>
public List<string> Args { get; private set; }
/// <summary>
/// Gets the arguments associated with the action.
/// </summary>
public List<string> Args { get; private set; }

/// <summary>
/// Initializes a new instance of the <see cref="LuxAction"/> class.
/// </summary>
/// <param name="id">The unique identifier for the action.</param>
/// <param name="toolId">The unique identifier for the associated tool.</param>
/// <param name="parameters">The parameters associated with the action.</param>
/// <param name="args">The arguments associated with the action.</param>
public LuxAction(Guid id, Guid toolId, List<string> parameters, List<string> args)
{
Id = id;
ToolId = toolId;
Parameters = parameters ?? new List<string>();
Args = args ?? new List<string>();
}
/// <summary>
/// Initializes a new instance of the <see cref="LuxAction"/> class.
/// </summary>
/// <param name="id">The unique identifier for the action.</param>
/// <param name="toolId">The unique identifier for the associated tool.</param>
/// <param name="parameters">The parameters associated with the action.</param>
/// <param name="args">The arguments associated with the action.</param>
public LuxAction(Guid id, Guid toolId, List<string> parameters, List<string> args)
{
Id = id;
ToolId = toolId;
Parameters = parameters ?? new List<string>();
Args = args ?? new List<string>();
}
}
44 changes: 20 additions & 24 deletions Luxoria.App/Luxoria.Modules/Models/LuxAsset.cs
Original file line number Diff line number Diff line change
@@ -1,31 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Diagnostics.CodeAnalysis;

namespace Luxoria.Modules.Models
namespace Luxoria.Modules.Models;

/// <summary>
/// Contains the properties of an asset in the Luxoria application.
/// Data -> ImageData
/// ConfigFile -> LuxCfg
/// </summary>
[ExcludeFromCodeCoverage]
public class LuxAsset
{
/// <summary>
/// Contains the properties of an asset in the Luxoria application.
/// Data -> ImageData
/// ConfigFile -> LuxCfg
/// Gets the unique identifier for the asset.
/// </summary>
public class LuxAsset
{
/// <summary>
/// Gets the unique identifier for the asset.
/// </summary>
public Guid Id => MetaData.Id;
public Guid Id => MetaData.Id;

/// <summary>
/// Contains the properties of the asset.
/// </summary>
public required LuxCfg MetaData { get; init; }
/// <summary>
/// Contains the properties of the asset.
/// </summary>
public required LuxCfg MetaData { get; init; }

/// <summary>
/// Contains the data of the asset.
/// </summary>
public required ImageData Data { get; init; }
}
/// <summary>
/// Contains the data of the asset.
/// </summary>
public required ImageData Data { get; init; }
}
153 changes: 76 additions & 77 deletions Luxoria.App/Luxoria.Modules/Models/LuxCfg.cs
Original file line number Diff line number Diff line change
@@ -1,94 +1,93 @@
using System.Collections.Generic;
using Luxoria.Modules.Models;
using System.Diagnostics.CodeAnalysis;

namespace Luxoria.Modules.Models
namespace Luxoria.Modules.Models;

/// <summary>
/// Represents a picture with its properties and associated actions and versioning.
/// </summary>
[ExcludeFromCodeCoverage]
public class LuxCfg
{
/// <summary>
/// Represents a picture with its properties and associated actions and versioning.
/// Gets the configuration version of the Luxoria application.
/// </summary>
public class LuxCfg
{
/// <summary>
/// Gets the configuration version of the Luxoria application.
/// </summary>
public string Version { get; private set; }
public string Version { get; private set; }

/// <summary>
/// Gets the unique identifier for the picture.
/// </summary>
public Guid Id { get; private set; }
/// <summary>
/// Gets the unique identifier for the picture.
/// </summary>
public Guid Id { get; private set; }

/// <summary>
/// Gets the name of the picture.
/// </summary>
public string Name { get; private set; }
/// <summary>
/// Gets the name of the picture.
/// </summary>
public string Name { get; private set; }

/// <summary>
/// Gets the file name of the picture.
/// </summary>
public string FileName { get; private set; }
/// <summary>
/// Gets the file name of the picture.
/// </summary>
public string FileName { get; private set; }

/// <summary>
/// Gets the description of the picture.
/// </summary>
public string Description { get; private set; }
/// <summary>
/// Gets the description of the picture.
/// </summary>
public string Description { get; private set; }

/// <summary>
/// Gets the file extension of the picture.
/// </summary>
public FileExtension Extension { get; private set; }
/// <summary>
/// Gets the file extension of the picture.
/// </summary>
public FileExtension Extension { get; private set; }

/// <summary>ff
/// Gets the full name of the picture, combining the name and extension.
/// </summary>
public string FullName => FileName;
/// <summary>ff
/// Gets the full name of the picture, combining the name and extension.
/// </summary>
public string FullName => FileName;

/// <summary>
/// Gets the list of actions associated with the picture.
/// </summary>
public List<LuxAction> Actions { get; private set; }
/// <summary>
/// Gets the list of actions associated with the picture.
/// </summary>
public List<LuxAction> Actions { get; private set; }

/// <summary>
/// Gets the list of versions associated with the picture.
/// </summary>
public List<LuxVersion> Versionning { get; private set; }
/// <summary>
/// Gets the list of versions associated with the picture.
/// </summary>
public List<LuxVersion> Versionning { get; private set; }

/// <summary>
/// Initializes a new instance of the <see cref="Picture"/> class.
/// </summary>
/// <param name="version">The configuration version of Luxoria.</param>
/// <param name="name">The name of the picture.</param>
/// <param name="fileName">The file name of the picture.</param>
/// <param name="description">The description of the picture.</param>
/// <param name="extension">The file extension of the picture.</param>
/// <param name="actions">The list of actions associated with the picture.</param>
/// <param name="versionning">The list of versions associated with the picture.</param>
public LuxCfg(string version, Guid fileUuid, string name, string fileName, string description, FileExtension extension)
{
Version = version;
/// <summary>
/// Initializes a new instance of the <see cref="Picture"/> class.
/// </summary>
/// <param name="version">The configuration version of Luxoria.</param>
/// <param name="name">The name of the picture.</param>
/// <param name="fileName">The file name of the picture.</param>
/// <param name="description">The description of the picture.</param>
/// <param name="extension">The file extension of the picture.</param>
/// <param name="actions">The list of actions associated with the picture.</param>
/// <param name="versionning">The list of versions associated with the picture.</param>
public LuxCfg(string version, Guid fileUuid, string name, string fileName, string description, FileExtension extension)
{
Version = version;

Id = fileUuid;
Name = name;
FileName = fileName;
Description = description;
Extension = extension;
Actions = new List<LuxAction>();
Versionning = new List<LuxVersion>();
}
Id = fileUuid;
Name = name;
FileName = fileName;
Description = description;
Extension = extension;
Actions = new List<LuxAction>();
Versionning = new List<LuxVersion>();
}

/// <summary>
/// Public model 'Asset interface'
/// </summary>
public class AssetInterface
{
// File name
public required string FileName { get; set; }
// Relative file path
public required string RelativeFilePath { get; set; }
// Related Luxoria Config Id
public required Guid LuxCfgId { get; set; }
// File hash (SHA-256)
public required string Hash { get; set; }
}
/// <summary>
/// Public model 'Asset interface'
/// </summary>
public class AssetInterface
{
// File name
public required string FileName { get; set; }
// Relative file path
public required string RelativeFilePath { get; set; }
// Related Luxoria Config Id
public required Guid LuxCfgId { get; set; }
// File hash (SHA-256)
public required string Hash { get; set; }
}
}
6 changes: 5 additions & 1 deletion Luxoria.App/Luxoria.Modules/Models/LuxVersion.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
namespace Luxoria.Modules.Models;
using System.Diagnostics.CodeAnalysis;

namespace Luxoria.Modules.Models;

[ExcludeFromCodeCoverage]
public class LuxVersion
{
/// <summary>
Expand Down
1 change: 0 additions & 1 deletion Luxoria.App/Luxoria.Modules/ModuleContext.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using Luxoria.Modules.Interfaces;
using Luxoria.Modules.Models;
using System;

namespace Luxoria.Modules
{
Expand Down

0 comments on commit a62af85

Please sign in to comment.