mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 17:11:10 +00:00
Adds domain Music aggregate
This commit is contained in:
1 parent
bde08c7440
commit
3a720af29f
100 files changed
+13077
-558
No files matched your search
+8
-7
@@ -2,6 +2,7 @@
|
||||
using DomainErrors = Lumina.Domain.Common.Errors.Errors;
|
||||
using Lumina.Domain.Common.Primitives;
|
||||
using Lumina.Domain.Common.ValueObjects.Metadata;
|
||||
using Lumina.Domain.SharedKernel.Common.Enums.Common;
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
@@ -23,7 +24,7 @@ public class ReleaseInfoTests
|
||||
Optional<int>.Some(2001),
|
||||
Optional<DateOnly>.Some(new DateOnly(2010, 6, 1)),
|
||||
Optional<int>.Some(2010),
|
||||
Optional<string>.Some("US"),
|
||||
Optional<ReleaseCountry>.Some(ReleaseCountry.US),
|
||||
Optional<string>.Some("Director's Cut"));
|
||||
|
||||
// Assert
|
||||
@@ -32,7 +33,7 @@ public class ReleaseInfoTests
|
||||
Assert.Equal(2001, result.Value.OriginalReleaseYear.Value);
|
||||
Assert.Equal(new DateOnly(2010, 6, 1), result.Value.ReReleaseDate.Value);
|
||||
Assert.Equal(2010, result.Value.ReReleaseYear.Value);
|
||||
Assert.Equal("US", result.Value.ReleaseCountry.Value);
|
||||
Assert.Equal(ReleaseCountry.US, result.Value.ReleaseCountry.Value);
|
||||
Assert.Equal("Director's Cut", result.Value.ReleaseVersion.Value);
|
||||
}
|
||||
|
||||
@@ -45,7 +46,7 @@ public class ReleaseInfoTests
|
||||
Optional<int>.Some(2001),
|
||||
Optional<DateOnly>.None(),
|
||||
Optional<int>.None(),
|
||||
Optional<string>.None(),
|
||||
Optional<ReleaseCountry>.None(),
|
||||
Optional<string>.None());
|
||||
|
||||
// Assert
|
||||
@@ -63,7 +64,7 @@ public class ReleaseInfoTests
|
||||
Optional<int>.Some(2002),
|
||||
Optional<DateOnly>.None(),
|
||||
Optional<int>.None(),
|
||||
Optional<string>.None(),
|
||||
Optional<ReleaseCountry>.None(),
|
||||
Optional<string>.None());
|
||||
|
||||
// Assert
|
||||
@@ -80,7 +81,7 @@ public class ReleaseInfoTests
|
||||
Optional<int>.None(),
|
||||
Optional<DateOnly>.Some(new DateOnly(2010, 6, 1)),
|
||||
Optional<int>.Some(2011),
|
||||
Optional<string>.None(),
|
||||
Optional<ReleaseCountry>.None(),
|
||||
Optional<string>.None());
|
||||
|
||||
// Assert
|
||||
@@ -97,7 +98,7 @@ public class ReleaseInfoTests
|
||||
Optional<int>.Some(2010),
|
||||
Optional<DateOnly>.Some(new DateOnly(2001, 9, 14)),
|
||||
Optional<int>.Some(2001),
|
||||
Optional<string>.None(),
|
||||
Optional<ReleaseCountry>.None(),
|
||||
Optional<string>.None());
|
||||
|
||||
// Assert
|
||||
@@ -114,7 +115,7 @@ public class ReleaseInfoTests
|
||||
Optional<int>.Some(2010),
|
||||
Optional<DateOnly>.None(),
|
||||
Optional<int>.Some(2001),
|
||||
Optional<string>.None(),
|
||||
Optional<ReleaseCountry>.None(),
|
||||
Optional<string>.None());
|
||||
|
||||
// Assert
|
||||
|
||||
+3
-3
@@ -1,15 +1,15 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Domain.Common.Primitives;
|
||||
using Lumina.Domain.Common.ValueObjects.Metadata;
|
||||
using Lumina.Domain.Core.BoundedContexts.AudioLibraryBoundedContext.AudioLibraryAggregate.ValueObjects;
|
||||
using Lumina.Domain.Core.BoundedContexts.AudioLibraryBoundedContext.Common.ValueObjects;
|
||||
using Lumina.Domain.Fixtures.Common.ValueObjects.Metadata;
|
||||
using Lumina.Domain.Fixtures.Core.BoundedContexts.AudioLibraryBoundedContext.AudioLibraryAggregate.ValueObjects;
|
||||
using Lumina.Domain.Fixtures.Core.BoundedContexts.AudioLibraryBoundedContext.Common.ValueObjects;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.BoundedContexts.AudioLibraryBoundedContext.AudioLibraryAggregate.ValueObjects;
|
||||
namespace Lumina.Domain.UnitTests.Core.BoundedContexts.AudioLibraryBoundedContext.Common.ValueObjects;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="AudioMetadata"/> class.
|
||||
+4
-3
@@ -4,6 +4,7 @@ using Lumina.Domain.Core.BoundedContexts.MediaContributorBoundedContext.MediaCon
|
||||
using Lumina.Domain.Core.BoundedContexts.MediaContributorBoundedContext.MediaContributorAggregate.ValueObjects;
|
||||
using Lumina.Domain.Fixtures.Core.BoundedContexts.MediaContributorBoundedContext.MediaContributorAggregate;
|
||||
using Lumina.Domain.Fixtures.Core.BoundedContexts.MediaContributorBoundedContext.MediaContributorAggregate.ValueObjects;
|
||||
using Lumina.Domain.SharedKernel.Common.Enums.MediaContributors;
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
@@ -31,7 +32,7 @@ public class MediaContributorTests
|
||||
Optional<DateOnly> dateOfDeath = Optional<DateOnly>.None();
|
||||
|
||||
// Act
|
||||
Result<MediaContributor> result = MediaContributor.Create(id, name, biography, dateOfBirth, dateOfDeath);
|
||||
Result<MediaContributor> result = MediaContributor.Create(id, MediaContributorType.Person, name, biography, dateOfBirth, dateOfDeath);
|
||||
|
||||
// Assert
|
||||
Assert.False(result.IsFailure);
|
||||
@@ -51,7 +52,7 @@ public class MediaContributorTests
|
||||
MediaContributorName name = _mediaContributorNameFixture.Create(displayName: "Jane Doe", legalName: Optional<string>.None());
|
||||
|
||||
// Act
|
||||
Result<MediaContributor> result = MediaContributor.Create(_mediaContributorIdFixture.Create(), name, Optional<string>.None(), Optional<DateOnly>.None(), Optional<DateOnly>.None());
|
||||
Result<MediaContributor> result = MediaContributor.Create(_mediaContributorIdFixture.Create(), MediaContributorType.Person, name, Optional<string>.None(), Optional<DateOnly>.None(), Optional<DateOnly>.None());
|
||||
|
||||
// Assert
|
||||
Assert.False(result.IsFailure);
|
||||
@@ -67,7 +68,7 @@ public class MediaContributorTests
|
||||
MediaContributorName name = _mediaContributorNameFixture.Create(displayName: "Jane Doe", legalName: Optional<string>.None());
|
||||
|
||||
// Act
|
||||
Result<MediaContributor> result = MediaContributor.Create(name);
|
||||
Result<MediaContributor> result = MediaContributor.Create(MediaContributorType.Person, name);
|
||||
|
||||
// Assert
|
||||
Assert.False(result.IsFailure);
|
||||
|
||||
-24
@@ -1,24 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Domain.Core.BoundedContexts.VideoLibraryBoundedContext.MovieLibraryAggregate.Services;
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.BoundedContexts.VideoLibraryBoundedContext.MovieLibraryAggregate.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="MovieLibraryService"/> class.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class MovieLibraryServiceTests
|
||||
{
|
||||
[Fact]
|
||||
public void Movies_WhenAccessed_ShouldThrowNotImplementedException()
|
||||
{
|
||||
// Arrange
|
||||
MovieLibraryService sut = new();
|
||||
|
||||
// Act & Assert
|
||||
Assert.Throws<NotImplementedException>(() => sut.Movies);
|
||||
}
|
||||
}
|
||||
-31
@@ -1,31 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Domain.Core.BoundedContexts.VideoLibraryBoundedContext.MovieLibraryAggregate.Services;
|
||||
using Lumina.Domain.Core.BoundedContexts.VideoLibraryBoundedContext.Services;
|
||||
using Lumina.Domain.Core.BoundedContexts.VideoLibraryBoundedContext.TvShowLibraryAggregate.Services;
|
||||
using NSubstitute;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.BoundedContexts.VideoLibraryBoundedContext.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="VideoLibraryService"/> class.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class VideoLibraryServiceTests
|
||||
{
|
||||
[Fact]
|
||||
public void Constructor_WhenCalled_ShouldSetInjectedServices()
|
||||
{
|
||||
// Arrange
|
||||
IMovieLibraryService movieLibraryService = Substitute.For<IMovieLibraryService>();
|
||||
ITvShowLibraryService tvShowLibraryService = Substitute.For<ITvShowLibraryService>();
|
||||
|
||||
// Act
|
||||
VideoLibraryService sut = new(movieLibraryService, tvShowLibraryService);
|
||||
|
||||
// Assert
|
||||
Assert.Same(movieLibraryService, sut.MovieLibraryService);
|
||||
Assert.Same(tvShowLibraryService, sut.TvShowLibraryService);
|
||||
}
|
||||
}
|
||||
-24
@@ -1,24 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Domain.Core.BoundedContexts.VideoLibraryBoundedContext.TvShowLibraryAggregate.Services;
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.BoundedContexts.VideoLibraryBoundedContext.TvShowLibraryAggregate.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="TvShowLibraryService"/> class.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class TvShowLibraryServiceTests
|
||||
{
|
||||
[Fact]
|
||||
public void TvShows_WhenAccessed_ShouldThrowNotImplementedException()
|
||||
{
|
||||
// Arrange
|
||||
TvShowLibraryService sut = new();
|
||||
|
||||
// Act & Assert
|
||||
Assert.Throws<NotImplementedException>(() => sut.TvShows);
|
||||
}
|
||||
}
|
||||
-28
@@ -1,28 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Domain.Core.BoundedContexts.WrittenContentLibraryBoundedContext.BookLibraryAggregate.Services;
|
||||
using Lumina.Domain.Core.BoundedContexts.WrittenContentLibraryBoundedContext.Services;
|
||||
using NSubstitute;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.BoundedContexts.WrittenContentLibraryBoundedContext.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="WrittenContentLibraryService"/> class.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class WrittenContentLibraryServiceTests
|
||||
{
|
||||
[Fact]
|
||||
public void Constructor_WhenCalled_ShouldSetInjectedService()
|
||||
{
|
||||
// Arrange
|
||||
IBookLibraryService bookLibraryService = Substitute.For<IBookLibraryService>();
|
||||
|
||||
// Act
|
||||
WrittenContentLibraryService sut = new(bookLibraryService);
|
||||
|
||||
// Assert
|
||||
Assert.Same(bookLibraryService, sut.BookLibraryService);
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
#region ========================================================================= USING =====================================================================================
|
||||
using Lumina.Domain.Core.BoundedContexts.VideoLibraryBoundedContext.Services;
|
||||
using Lumina.Domain.Core.BoundedContexts.WrittenContentLibraryBoundedContext.Services;
|
||||
using Lumina.Domain.Core.Services;
|
||||
using NSubstitute;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
#endregion
|
||||
|
||||
namespace Lumina.Domain.UnitTests.Core.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Contains unit tests for the <see cref="MediaLibraryService"/> class.
|
||||
/// </summary>
|
||||
[ExcludeFromCodeCoverage]
|
||||
public class MediaLibraryServiceTests
|
||||
{
|
||||
[Fact]
|
||||
public void Constructor_WhenCalled_ShouldSetInjectedServices()
|
||||
{
|
||||
// Arrange
|
||||
IVideoLibraryService videoLibraryService = Substitute.For<IVideoLibraryService>();
|
||||
IWrittenContentLibraryService writtenContentLibraryService = Substitute.For<IWrittenContentLibraryService>();
|
||||
|
||||
// Act
|
||||
MediaLibraryService sut = new(videoLibraryService, writtenContentLibraryService);
|
||||
|
||||
// Assert
|
||||
Assert.Same(videoLibraryService, sut.VideoLibraryService);
|
||||
Assert.Same(writtenContentLibraryService, sut.WrittenContentLibraryService);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user