We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 10aca36 commit 6c187f0Copy full SHA for 6c187f0
BlogWebApp/Tests/Blog.ServicesTests/EntityServices/ProfileServiceTests.cs
@@ -156,6 +156,21 @@ public void GetAll_WhenProfilesDoesNotExists_ShouldReturnNothing()
156
Assert.Empty(profiles);
157
}
158
159
+ /// <summary>
160
+ /// Get all profiles.
161
+ /// Should throw exception when repository throws exception.
162
+ /// </summary>
163
+ [Fact]
164
+ public void GetAll_WhenRepositoryThrowsException_ShouldThrowException()
165
+ {
166
+ //Arrange
167
+ _profileRepositoryMock.Setup(x => x.GetAll())
168
+ .Throws(() => new Exception("Test exception"));
169
+
170
+ //Assert
171
+ Assert.Throws<Exception>(() => _profileService.GetAll());
172
+ }
173
174
#endregion
175
176
#region Get All Async function
0 commit comments