We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e9f51d3 commit 59683bbCopy full SHA for 59683bb
BlogWebApp/Tests/Blog.ServicesTests/EntityServices/TagsServiceTests.cs
@@ -147,6 +147,20 @@ public void GetAll_WhenTagsDoesNotExists_ShouldReturnNothing()
147
}
148
149
/// <summary>
150
+ /// Get all tags.
151
+ /// Should throw exception when repository throws exception.
152
+ /// </summary>
153
+ [Fact]
154
+ public void GetAll_WhenRepositoryThrowsException_ShouldThrowException()
155
+ {
156
+ //Arrange
157
+ _tagsRepositoryMock.Setup(x => x.GetAll())
158
+ .Throws(() => new Exception("Test exception"));
159
+
160
+ //Assert
161
+ Assert.Throws<Exception>(() => _tagsService.GetAll());
162
+ }
163
164
#endregion
165
166
#region Get All Async function
0 commit comments