66using NUnit . Framework ;
77using System ;
88using System . Collections . Generic ;
9- using System . Threading . Tasks ;
109
1110namespace CSharp . UnitTesting . Api . NUnit . Test . Services . FluentAssertions
1211{
13- [ Property ( "NUnit | FluentAssertions" , "Service | Channel" ) ]
14- public class ChannelServiceTest
12+ [ Property ( "NUnit + FluentAssertions | Services" , nameof ( ChannelService ) ) ]
13+ public sealed class ChannelServiceTest
1514 {
1615 private readonly IChannelService channelService ;
1716
@@ -24,10 +23,10 @@ public ChannelServiceTest()
2423 public void GivenGetAllAsyncWhenExpectedExceptionIsThrownThenHandlesGracefully ( )
2524 {
2625 // Arrange
27- async Task action ( ) => await channelService . GetAllAsync ( ) ;
2826
2927 // Act
30- var exception = Assert . ThrowsAsync < NotImplementedException > ( action ) ;
28+ var exception = Assert . ThrowsAsync < NotImplementedException > (
29+ ( ) => channelService . GetAllAsync ( ) ) ;
3130
3231 // Assert
3332 exception . Should ( ) . NotBeNull ( ) . And . BeOfType < NotImplementedException > ( ) ;
@@ -37,10 +36,10 @@ public void GivenGetAllAsyncWhenExpectedExceptionIsThrownThenHandlesGracefully()
3736 public void GivenGetByIdAsyncWhenExpectedExceptionIsThrownThenHandlesGracefully ( )
3837 {
3938 // Arrange
40- async Task action ( ) => await channelService . GetByIdAsync ( It . IsAny < int > ( ) ) ;
4139
4240 // Act
43- var exception = Assert . ThrowsAsync < NotImplementedException > ( action ) ;
41+ var exception = Assert . ThrowsAsync < NotImplementedException > (
42+ ( ) => channelService . GetByIdAsync ( It . IsAny < int > ( ) ) ) ;
4443
4544 // Assert
4645 exception . Should ( ) . NotBeNull ( ) . And . BeOfType < NotImplementedException > ( ) ;
@@ -50,10 +49,10 @@ public void GivenGetByIdAsyncWhenExpectedExceptionIsThrownThenHandlesGracefully(
5049 public void GivenGetByIdsAsyncWhenExpectedExceptionIsThrownThenHandlesGracefully ( )
5150 {
5251 // Arrange
53- async Task action ( ) => await channelService . GetByIdsAsync ( It . IsAny < IEnumerable < int > > ( ) ) ;
5452
5553 // Act
56- var exception = Assert . ThrowsAsync < NotImplementedException > ( action ) ;
54+ var exception = Assert . ThrowsAsync < NotImplementedException > (
55+ ( ) => channelService . GetByIdsAsync ( It . IsAny < IEnumerable < int > > ( ) ) ) ;
5756
5857 // Assert
5958 exception . Should ( ) . NotBeNull ( ) . And . BeOfType < NotImplementedException > ( ) ;
@@ -63,10 +62,10 @@ public void GivenGetByIdsAsyncWhenExpectedExceptionIsThrownThenHandlesGracefully
6362 public void GivenGetTopAsyncWhenExpectedExceptionIsThrownThenHandlesGracefully ( )
6463 {
6564 // Arrange
66- async Task action ( ) => await channelService . GetTopAsync ( It . IsAny < int > ( ) ) ;
6765
6866 // Act
69- var exception = Assert . ThrowsAsync < NotImplementedException > ( action ) ;
67+ var exception = Assert . ThrowsAsync < NotImplementedException > (
68+ ( ) => channelService . GetTopAsync ( It . IsAny < int > ( ) ) ) ;
7069
7170 // Assert
7271 exception . Should ( ) . NotBeNull ( ) . And . BeOfType < NotImplementedException > ( ) ;
@@ -76,10 +75,10 @@ public void GivenGetTopAsyncWhenExpectedExceptionIsThrownThenHandlesGracefully()
7675 public void GivenCreateAsyncWhenExpectedExceptionIsThrownThenHandlesGracefully ( )
7776 {
7877 // Arrange
79- async Task action ( ) => await channelService . CreateAsync ( It . IsAny < Channel > ( ) ) ;
8078
8179 // Act
82- var exception = Assert . ThrowsAsync < NotImplementedException > ( action ) ;
80+ var exception = Assert . ThrowsAsync < NotImplementedException > (
81+ ( ) => channelService . CreateAsync ( It . IsAny < Channel > ( ) ) ) ;
8382
8483 // Assert
8584 exception . Should ( ) . NotBeNull ( ) . And . BeOfType < NotImplementedException > ( ) ;
@@ -89,10 +88,10 @@ public void GivenCreateAsyncWhenExpectedExceptionIsThrownThenHandlesGracefully()
8988 public void GivenCreateBulkAsyncWhenExpectedExceptionIsThrownThenHandlesGracefully ( )
9089 {
9190 // Arrange
92- async Task action ( ) => await channelService . CreateBulkAsync ( It . IsAny < IEnumerable < Channel > > ( ) ) ;
9391
9492 // Act
95- var exception = Assert . ThrowsAsync < NotImplementedException > ( action ) ;
93+ var exception = Assert . ThrowsAsync < NotImplementedException > (
94+ ( ) => channelService . CreateBulkAsync ( It . IsAny < IEnumerable < Channel > > ( ) ) ) ;
9695
9796 // Assert
9897 exception . Should ( ) . NotBeNull ( ) . And . BeOfType < NotImplementedException > ( ) ;
@@ -102,10 +101,10 @@ public void GivenCreateBulkAsyncWhenExpectedExceptionIsThrownThenHandlesGraceful
102101 public void GivenUpdateAsyncWhenExpectedExceptionIsThrownThenHandlesGracefully ( )
103102 {
104103 // Arrange
105- async Task action ( ) => await channelService . UpdateAsync ( It . IsAny < Channel > ( ) , It . IsAny < int > ( ) ) ;
106104
107105 // Act
108- var exception = Assert . ThrowsAsync < NotImplementedException > ( action ) ;
106+ var exception = Assert . ThrowsAsync < NotImplementedException > (
107+ ( ) => channelService . UpdateAsync ( It . IsAny < Channel > ( ) , It . IsAny < int > ( ) ) ) ;
109108
110109 // Assert
111110 exception . Should ( ) . NotBeNull ( ) . And . BeOfType < NotImplementedException > ( ) ;
@@ -115,10 +114,10 @@ public void GivenUpdateAsyncWhenExpectedExceptionIsThrownThenHandlesGracefully()
115114 public void GivenUpdateBulkAsyncWhenExpectedExceptionIsThrownThenHandlesGracefully ( )
116115 {
117116 // Arrange
118- async Task action ( ) => await channelService . UpdateBulkAsync ( It . IsAny < IEnumerable < Channel > > ( ) ) ;
119117
120118 // Act
121- var exception = Assert . ThrowsAsync < NotImplementedException > ( action ) ;
119+ var exception = Assert . ThrowsAsync < NotImplementedException > (
120+ ( ) => channelService . UpdateBulkAsync ( It . IsAny < IEnumerable < Channel > > ( ) ) ) ;
122121
123122 // Assert
124123 exception . Should ( ) . NotBeNull ( ) . And . BeOfType < NotImplementedException > ( ) ;
@@ -128,10 +127,10 @@ public void GivenUpdateBulkAsyncWhenExpectedExceptionIsThrownThenHandlesGraceful
128127 public void GivenDeleteAsyncWhenExpectedExceptionIsThrownThenHandlesGracefully ( )
129128 {
130129 // Arrange
131- async Task action ( ) => await channelService . DeleteAsync ( It . IsAny < int > ( ) ) ;
132130
133131 // Act
134- var exception = Assert . ThrowsAsync < NotImplementedException > ( action ) ;
132+ var exception = Assert . ThrowsAsync < NotImplementedException > (
133+ ( ) => channelService . DeleteAsync ( It . IsAny < int > ( ) ) ) ;
135134
136135 // Assert
137136 exception . Should ( ) . NotBeNull ( ) . And . BeOfType < NotImplementedException > ( ) ;
@@ -141,10 +140,10 @@ public void GivenDeleteAsyncWhenExpectedExceptionIsThrownThenHandlesGracefully()
141140 public void GivenDeleteBulkAsyncWhenExpectedExceptionIsThrownThenHandlesGracefully ( )
142141 {
143142 // Arrange
144- async Task action ( ) => await channelService . DeleteBulkAsync ( It . IsAny < IEnumerable < int > > ( ) ) ;
145143
146144 // Act
147- var exception = Assert . ThrowsAsync < NotImplementedException > ( action ) ;
145+ var exception = Assert . ThrowsAsync < NotImplementedException > (
146+ ( ) => channelService . DeleteBulkAsync ( It . IsAny < IEnumerable < int > > ( ) ) ) ;
148147
149148 // Assert
150149 exception . Should ( ) . NotBeNull ( ) . And . BeOfType < NotImplementedException > ( ) ;
0 commit comments