mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-02 20:11:10 +00:00
Refactors the get books and get books lite slices across the stack
This commit is contained in:
1 parent
001146eefc
commit
1d35cd01db
44 files changed
+1681
-418
No files matched your search
+15
-3
@@ -32,7 +32,6 @@ public class GetBooksLiteRequestTests
|
||||
|
||||
// Assert
|
||||
Assert.NotNull(sut);
|
||||
Assert.NotEqual(Guid.Empty, sut.LibraryId);
|
||||
Assert.True(sut.CurrentPage.HasValue);
|
||||
Assert.True(sut.PerPage.HasValue);
|
||||
}
|
||||
@@ -72,10 +71,9 @@ public class GetBooksLiteRequestTests
|
||||
GetBooksLiteRequest sut = _getBooksLiteRequestFixture.Create();
|
||||
|
||||
// Act
|
||||
(Guid libraryId, int? currentPage, int? perPage, string? searchTerm, string? filterAlphaKey, bool shouldIgnoreThePrefixForAlphaPicker, string? sortBy, SortOrder? sortOrder) = sut;
|
||||
(int? currentPage, int? perPage, string? searchTerm, string? filterAlphaKey, bool shouldIgnoreThePrefixForAlphaPicker, string? sortBy, SortOrder? sortOrder) = sut;
|
||||
|
||||
// Assert
|
||||
Assert.Equal(sut.LibraryId, libraryId);
|
||||
Assert.Equal(sut.CurrentPage, currentPage);
|
||||
Assert.Equal(sut.PerPage, perPage);
|
||||
Assert.Equal(sut.SearchTerm, searchTerm);
|
||||
@@ -84,4 +82,18 @@ public class GetBooksLiteRequestTests
|
||||
Assert.Equal(sut.SortBy, sortBy);
|
||||
Assert.Equal(sut.SortOrder, sortOrder);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Equality_WhenTwoInstancesHaveSameValues_ShouldBeEqual()
|
||||
{
|
||||
// Arrange
|
||||
GetBooksLiteRequest first = _getBooksLiteRequestFixture.Create();
|
||||
GetBooksLiteRequest second = first with { };
|
||||
|
||||
// Act
|
||||
bool areEqual = first == second;
|
||||
|
||||
// Assert
|
||||
Assert.True(areEqual);
|
||||
}
|
||||
}
|
||||
+15
-3
@@ -32,7 +32,6 @@ public class GetBooksRequestTests
|
||||
|
||||
// Assert
|
||||
Assert.NotNull(sut);
|
||||
Assert.NotEqual(Guid.Empty, sut.LibraryId);
|
||||
Assert.True(sut.CurrentPage.HasValue);
|
||||
Assert.True(sut.PerPage.HasValue);
|
||||
}
|
||||
@@ -72,14 +71,27 @@ public class GetBooksRequestTests
|
||||
GetBooksRequest sut = _getBooksRequestFixture.Create();
|
||||
|
||||
// Act
|
||||
(Guid libraryId, int? currentPage, int? perPage, string? searchTerm, string? sortBy, SortOrder? sortOrder) = sut;
|
||||
(int? currentPage, int? perPage, string? searchTerm, string? sortBy, SortOrder? sortOrder) = sut;
|
||||
|
||||
// Assert
|
||||
Assert.Equal(sut.LibraryId, libraryId);
|
||||
Assert.Equal(sut.CurrentPage, currentPage);
|
||||
Assert.Equal(sut.PerPage, perPage);
|
||||
Assert.Equal(sut.SearchTerm, searchTerm);
|
||||
Assert.Equal(sut.SortBy, sortBy);
|
||||
Assert.Equal(sut.SortOrder, sortOrder);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Equality_WhenTwoInstancesHaveSameValues_ShouldBeEqual()
|
||||
{
|
||||
// Arrange
|
||||
GetBooksRequest first = _getBooksRequestFixture.Create();
|
||||
GetBooksRequest second = first with { };
|
||||
|
||||
// Act
|
||||
bool areEqual = first == second;
|
||||
|
||||
// Assert
|
||||
Assert.True(areEqual);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user