mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 08:11:10 +00:00
eliminates region sections
This commit is contained in:
1 parent
705c02b90d
commit
405fc1ff9a
370 files changed
+47
-1618
No files matched your search
-6
@@ -26,13 +26,10 @@ namespace Lumina.DataAccess.UnitTests.Core.Repositories.Books;
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class BookRepositoryTests
|
||||
{
|
||||
#region ================================================================== FIELD MEMBERS ================================================================================
|
||||
private readonly LuminaDbContext _mockContext;
|
||||
private readonly BookRepository _sut;
|
||||
private readonly BookModelFixture _bookModelFixture;
|
||||
#endregion
|
||||
|
||||
#region ====================================================================== CTOR =====================================================================================
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="BookRepositoryTests"/> class.
|
||||
/// </summary>
|
||||
@@ -42,9 +39,7 @@ public class BookRepositoryTests
|
||||
_sut = new BookRepository(_mockContext);
|
||||
_bookModelFixture = new BookModelFixture();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ===================================================================== METHODS ===================================================================================
|
||||
[Fact]
|
||||
public async Task InsertAsync_WhenBookDoesNotExist_ShouldAddBookToContextAndReturnCreated()
|
||||
{
|
||||
@@ -194,5 +189,4 @@ public class BookRepositoryTests
|
||||
retrievedBook.Genres.Should().HaveCount(2);
|
||||
retrievedBook.ISBNs.Should().HaveCount(2);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
-6
@@ -19,13 +19,10 @@ namespace Lumina.DataAccess.UnitTests.Core.Repositories.Books.Fixtures;
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class BookModelFixture
|
||||
{
|
||||
#region ================================================================== FIELD MEMBERS ================================================================================
|
||||
private readonly Fixture _fixture;
|
||||
private readonly Random _random = new();
|
||||
private readonly Faker _faker;
|
||||
#endregion
|
||||
|
||||
#region ====================================================================== CTOR =====================================================================================
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="BookModelFixture"/> class.
|
||||
/// </summary>
|
||||
@@ -37,9 +34,7 @@ public class BookModelFixture
|
||||
_faker = new Faker();
|
||||
ConfigureCustomTypes();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ===================================================================== METHODS ===================================================================================
|
||||
/// <summary>
|
||||
/// Creates a random valid BookModel.
|
||||
/// </summary>
|
||||
@@ -204,5 +199,4 @@ public class BookModelFixture
|
||||
_fixture.Create<int>()
|
||||
));
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
-6
@@ -17,11 +17,8 @@ namespace Lumina.DataAccess.UnitTests.Core.Repositories.Common.Factory;
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class RepositoryDictionaryTests
|
||||
{
|
||||
#region ================================================================== FIELD MEMBERS ================================================================================
|
||||
private readonly IFixture _fixture;
|
||||
#endregion
|
||||
|
||||
#region ====================================================================== CTOR =====================================================================================
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="RepositoryDictionaryTests"/> class.
|
||||
/// </summary>
|
||||
@@ -29,9 +26,7 @@ public class RepositoryDictionaryTests
|
||||
{
|
||||
_fixture = new Fixture().Customize(new AutoNSubstituteCustomization());
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ===================================================================== METHODS ===================================================================================
|
||||
[Fact]
|
||||
public void Add_WhenValidRepositoryItemIsAdded_ShouldIncreaseCount()
|
||||
{
|
||||
@@ -111,5 +106,4 @@ public class RepositoryDictionaryTests
|
||||
Action act = () => repositoryDictionary.Add(nonRepository);
|
||||
act.Should().Throw<ArgumentException>().WithMessage("Value must implement IRepository interface!");
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
-2
@@ -16,7 +16,6 @@ namespace Lumina.DataAccess.UnitTests.Core.Repositories.Common.Factory;
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class RepositoryFactoryTests
|
||||
{
|
||||
#region ===================================================================== METHODS ===================================================================================
|
||||
[Fact]
|
||||
public void CreateRepository_WhenCalled_ShouldReturnCorrectRepository()
|
||||
{
|
||||
@@ -47,7 +46,6 @@ public class RepositoryFactoryTests
|
||||
Action act = () => repositoryFactory.CreateRepository<IUnregisteredRepository>();
|
||||
act.Should().Throw<InvalidOperationException>().WithMessage("No service for type 'Lumina.DataAccess.UnitTests.Core.Repositories.Common.Factory.IUnregisteredRepository' has been registered.");
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
public interface IUnregisteredRepository { }
|
||||
Reference in new issue
Block a user