@@ -21,19 +21,13 @@ public class ImageOperationTests : IDisposable
2121 {
2222 private readonly Image < Rgba32 > image ;
2323 private readonly FakeImageOperationsProvider provider ;
24- private readonly IImageProcessor < Rgba32 > processorImplementation ;
25-
2624 private readonly IImageProcessor processorDefinition ;
2725
28- public Configuration Configuration { get ; private set ; }
29-
3026 public ImageOperationTests ( )
3127 {
3228 this . provider = new FakeImageOperationsProvider ( ) ;
33- this . processorImplementation = new Mock < IImageProcessor < Rgba32 > > ( ) . Object ;
34-
29+
3530 Mock < IImageProcessor > processorMock = new Mock < IImageProcessor > ( ) ;
36- processorMock . Setup ( p => p . CreatePixelSpecificProcessor < Rgba32 > ( ) ) . Returns ( this . processorImplementation ) ;
3731 this . processorDefinition = processorMock . Object ;
3832
3933 this . image = new Image < Rgba32 > ( new Configuration ( )
@@ -48,7 +42,9 @@ public void MutateCallsImageOperationsProvider_Func_OriginalImage()
4842 this . image . Mutate ( x => x . ApplyProcessor ( this . processorDefinition ) ) ;
4943
5044 Assert . True ( this . provider . HasCreated ( this . image ) ) ;
51- Assert . Contains ( this . processorImplementation , this . provider . AppliedOperations ( this . image ) . Select ( x => x . GenericProcessor ) ) ;
45+ Assert . Contains (
46+ this . processorDefinition ,
47+ this . provider . AppliedOperations ( this . image ) . Select ( x => x . NonGenericProcessor ) ) ;
5248 }
5349
5450 [ Fact ]
@@ -57,7 +53,9 @@ public void MutateCallsImageOperationsProvider_ListOfProcessors_OriginalImage()
5753 this . image . Mutate ( this . processorDefinition ) ;
5854
5955 Assert . True ( this . provider . HasCreated ( this . image ) ) ;
60- Assert . Contains ( this . processorImplementation , this . provider . AppliedOperations ( this . image ) . Select ( x => x . GenericProcessor ) ) ;
56+ Assert . Contains (
57+ this . processorDefinition ,
58+ this . provider . AppliedOperations ( this . image ) . Select ( x => x . NonGenericProcessor ) ) ;
6159 }
6260
6361 [ Fact ]
@@ -66,7 +64,9 @@ public void CloneCallsImageOperationsProvider_Func_WithDuplicateImage()
6664 Image < Rgba32 > returned = this . image . Clone ( x => x . ApplyProcessor ( this . processorDefinition ) ) ;
6765
6866 Assert . True ( this . provider . HasCreated ( returned ) ) ;
69- Assert . Contains ( this . processorImplementation , this . provider . AppliedOperations ( returned ) . Select ( x => x . GenericProcessor ) ) ;
67+ Assert . Contains (
68+ this . processorDefinition ,
69+ this . provider . AppliedOperations ( returned ) . Select ( x => x . NonGenericProcessor ) ) ;
7070 }
7171
7272 [ Fact ]
@@ -75,31 +75,37 @@ public void CloneCallsImageOperationsProvider_ListOfProcessors_WithDuplicateImag
7575 Image < Rgba32 > returned = this . image . Clone ( this . processorDefinition ) ;
7676
7777 Assert . True ( this . provider . HasCreated ( returned ) ) ;
78- Assert . Contains ( this . processorImplementation , this . provider . AppliedOperations ( returned ) . Select ( x => x . GenericProcessor ) ) ;
78+ Assert . Contains (
79+ this . processorDefinition ,
80+ this . provider . AppliedOperations ( returned ) . Select ( x => x . NonGenericProcessor ) ) ;
7981 }
8082
8183 [ Fact ]
8284 public void CloneCallsImageOperationsProvider_Func_NotOnOrigional ( )
8385 {
8486 Image < Rgba32 > returned = this . image . Clone ( x => x . ApplyProcessor ( this . processorDefinition ) ) ;
8587 Assert . False ( this . provider . HasCreated ( this . image ) ) ;
86- Assert . DoesNotContain ( this . processorImplementation , this . provider . AppliedOperations ( this . image ) . Select ( x => x . GenericProcessor ) ) ;
88+ Assert . DoesNotContain (
89+ this . processorDefinition ,
90+ this . provider . AppliedOperations ( this . image ) . Select ( x => x . NonGenericProcessor ) ) ;
8791 }
8892
8993 [ Fact ]
9094 public void CloneCallsImageOperationsProvider_ListOfProcessors_NotOnOrigional ( )
9195 {
9296 Image < Rgba32 > returned = this . image . Clone ( this . processorDefinition ) ;
9397 Assert . False ( this . provider . HasCreated ( this . image ) ) ;
94- Assert . DoesNotContain ( this . processorImplementation , this . provider . AppliedOperations ( this . image ) . Select ( x => x . GenericProcessor ) ) ;
98+ Assert . DoesNotContain (
99+ this . processorDefinition ,
100+ this . provider . AppliedOperations ( this . image ) . Select ( x => x . NonGenericProcessor ) ) ;
95101 }
96102
97103 [ Fact ]
98104 public void ApplyProcessors_ListOfProcessors_AppliesAllProcessorsToOperation ( )
99105 {
100106 var operations = new FakeImageOperationsProvider . FakeImageOperations < Rgba32 > ( null , false ) ;
101107 operations . ApplyProcessors ( this . processorDefinition ) ;
102- Assert . Contains ( this . processorImplementation , operations . Applied . Select ( x => x . GenericProcessor ) ) ;
108+ Assert . Contains ( this . processorDefinition , operations . Applied . Select ( x => x . NonGenericProcessor ) ) ;
103109 }
104110
105111 public void Dispose ( ) => this . image . Dispose ( ) ;
0 commit comments