-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump dependencies; YoloV8 library v4 breaking changes adaptation; Add…
… DbWeightsDataAccess tests; DbWeightsDataAccess before changes data loading capability;
- Loading branch information
Showing
16 changed files
with
110 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using SightKeeper.Data.Services; | ||
using SightKeeper.Domain.Model.DataSets; | ||
using SightKeeper.Tests.Common; | ||
|
||
namespace SightKeeper.Data.Tests; | ||
|
||
public sealed class DbWeightsDataAccessTests : DbRelatedTests | ||
{ | ||
[Fact] | ||
public void ShouldSaveAndLoadWeights() | ||
{ | ||
var dataSet = DomainTestsHelper.NewDataSet; | ||
var dbContext = DbContextFactory.CreateDbContext(); | ||
dbContext.Add(dataSet); | ||
DbWeightsDataAccess weightsDataAccess = new(dbContext); | ||
var weights = weightsDataAccess.CreateWeights(dataSet.Weights, [0], [1], Size.Large, new WeightsMetrics(), Array.Empty<ItemClass>()); | ||
dbContext.SaveChanges(); | ||
weightsDataAccess.LoadWeightsONNXData(weights).Content.Single().Should().Be(0); | ||
weightsDataAccess.LoadWeightsPTData(weights).Content.Single().Should().Be(1); | ||
} | ||
|
||
[Fact] | ||
public void ShouldSaveAndLoadWeightsWithoutSaving() | ||
{ | ||
var dataSet = DomainTestsHelper.NewDataSet; | ||
var dbContext = DbContextFactory.CreateDbContext(); | ||
dbContext.Add(dataSet); | ||
DbWeightsDataAccess weightsDataAccess = new(dbContext); | ||
var weights = weightsDataAccess.CreateWeights(dataSet.Weights, [0], [1], Size.Large, new WeightsMetrics(), Array.Empty<ItemClass>()); | ||
weightsDataAccess.LoadWeightsONNXData(weights).Content.Single().Should().Be(0); | ||
weightsDataAccess.LoadWeightsPTData(weights).Content.Single().Should().Be(1); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...ations/20240312211014_Initial.Designer.cs → ...ations/20240312223758_Initial.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters