From 8503a6f72f2e3e52015c0d1a90497d0db2e72150 Mon Sep 17 00:00:00 2001 From: David Driscoll Date: Sun, 13 Jan 2019 11:45:13 -0500 Subject: [PATCH] Fixed fake it easy changes --- .../ConventionScannerExtensionsTests.cs | 12 +++++------ test/Conventions.Tests/ConventionTests.cs | 8 ++++---- .../GenericConventionComposerTests.cs | 20 +++++++++---------- .../StaticConventionComposerTests.cs | 20 +++++++++---------- 4 files changed, 30 insertions(+), 30 deletions(-) diff --git a/test/Conventions.Tests/ConventionScannerExtensionsTests.cs b/test/Conventions.Tests/ConventionScannerExtensionsTests.cs index 2dcd9ae45..236eeaf3e 100644 --- a/test/Conventions.Tests/ConventionScannerExtensionsTests.cs +++ b/test/Conventions.Tests/ConventionScannerExtensionsTests.cs @@ -19,7 +19,7 @@ public void ShouldAddConvention_WithParams() scanner.PrependConvention(convention1, convention2, convention3); - A.CallTo(() => scanner.PrependConvention(A._)).MustHaveHappened(Repeated.Exactly.Times(3)); + A.CallTo(() => scanner.PrependConvention(A._)).MustHaveHappened(3, Times.Exactly); } [Fact] @@ -32,7 +32,7 @@ public void ShouldAddConvention_WithEnumerable() scanner.PrependConvention(new[] { convention1, convention2, convention3 }.AsEnumerable()); - A.CallTo(() => scanner.PrependConvention(A._)).MustHaveHappened(Repeated.Exactly.Times(3)); + A.CallTo(() => scanner.PrependConvention(A._)).MustHaveHappened(3, Times.Exactly); } [Fact] @@ -45,7 +45,7 @@ public void ShouldAddConventionDelegate_WithParams() scanner.PrependDelegate(d1, d2, d3); - A.CallTo(() => scanner.PrependDelegate(A._)).MustHaveHappened(Repeated.Exactly.Times(3)); + A.CallTo(() => scanner.PrependDelegate(A._)).MustHaveHappened(3, Times.Exactly); } [Fact] @@ -58,7 +58,7 @@ public void ShouldAddConventionDelegate_WithEnumerable() scanner.PrependDelegate(new[] { d1, d2, d3 }.AsEnumerable()); - A.CallTo(() => scanner.PrependDelegate(A._)).MustHaveHappened(Repeated.Exactly.Times(3)); + A.CallTo(() => scanner.PrependDelegate(A._)).MustHaveHappened(3, Times.Exactly); } [Fact] @@ -71,7 +71,7 @@ public void ShouldExcludeConvention_WithParams() scanner.ExceptConvention(d1, d2, d3); - A.CallTo(() => scanner.ExceptConvention(A._)).MustHaveHappened(Repeated.Exactly.Times(3)); + A.CallTo(() => scanner.ExceptConvention(A._)).MustHaveHappened(3, Times.Exactly); } [Fact] @@ -84,7 +84,7 @@ public void ShouldExcludeConvention_WithEnumerable() scanner.ExceptConvention(new[] { d1, d2, d3 }.AsEnumerable()); - A.CallTo(() => scanner.ExceptConvention(A._)).MustHaveHappened(Repeated.Exactly.Times(3)); + A.CallTo(() => scanner.ExceptConvention(A._)).MustHaveHappened(3, Times.Exactly); } } } diff --git a/test/Conventions.Tests/ConventionTests.cs b/test/Conventions.Tests/ConventionTests.cs index 2228d7beb..aefc18291 100644 --- a/test/Conventions.Tests/ConventionTests.cs +++ b/test/Conventions.Tests/ConventionTests.cs @@ -49,10 +49,10 @@ public void ComposerCallsValuesAsExpected() composer.Register(new ServiceConventionContext(Logger)); composer.Register(new ServiceConventionContext(Logger)); - A.CallTo(() => dele.Invoke(A._)).MustHaveHappened(Repeated.Exactly.Twice); - A.CallTo(() => dele2.Invoke(A._)).MustHaveHappened(Repeated.Exactly.Twice); - A.CallTo(() => contrib.Register(A._)).MustHaveHappened(Repeated.Exactly.Twice); - A.CallTo(() => contrib2.Register(A._)).MustHaveHappened(Repeated.Exactly.Twice); + A.CallTo(() => dele.Invoke(A._)).MustHaveHappenedTwiceExactly(); + A.CallTo(() => dele2.Invoke(A._)).MustHaveHappenedTwiceExactly(); + A.CallTo(() => contrib.Register(A._)).MustHaveHappenedTwiceExactly(); + A.CallTo(() => contrib2.Register(A._)).MustHaveHappenedTwiceExactly(); } } } diff --git a/test/Conventions.Tests/GenericConventionComposerTests.cs b/test/Conventions.Tests/GenericConventionComposerTests.cs index 6251972da..2d5013688 100644 --- a/test/Conventions.Tests/GenericConventionComposerTests.cs +++ b/test/Conventions.Tests/GenericConventionComposerTests.cs @@ -51,7 +51,7 @@ public void RegisterShouldCallConvention() composer.Register(context); - A.CallTo(() => contribution.Register(A._)).MustHaveHappened(Repeated.Exactly.Once); + A.CallTo(() => contribution.Register(A._)).MustHaveHappenedOnceExactly(); } [Fact] @@ -78,9 +78,9 @@ public void RegisterShouldCallConventions() composer.Register(context); - A.CallTo(() => contribution1.Register(A._)).MustHaveHappened(Repeated.Exactly.Once); - A.CallTo(() => contribution2.Register(A._)).MustHaveHappened(Repeated.Exactly.Once); - A.CallTo(() => contribution3.Register(A._)).MustHaveHappened(Repeated.Exactly.Once); + A.CallTo(() => contribution1.Register(A._)).MustHaveHappenedOnceExactly(); + A.CallTo(() => contribution2.Register(A._)).MustHaveHappenedOnceExactly(); + A.CallTo(() => contribution3.Register(A._)).MustHaveHappenedOnceExactly(); } [Fact] @@ -100,7 +100,7 @@ public void RegisterShouldCallDelegate() composer.Register(context); - A.CallTo(() => @delegate.Invoke(A._)).MustHaveHappened(Repeated.Exactly.Once); + A.CallTo(() => @delegate.Invoke(A._)).MustHaveHappenedOnceExactly(); } [Fact] @@ -127,9 +127,9 @@ public void RegisterShouldCallDelegates() composer.Register(context); - A.CallTo(() => @delegate1.Invoke(A._)).MustHaveHappened(Repeated.Exactly.Once); - A.CallTo(() => @delegate2.Invoke(A._)).MustHaveHappened(Repeated.Exactly.Once); - A.CallTo(() => @delegate3.Invoke(A._)).MustHaveHappened(Repeated.Exactly.Once); + A.CallTo(() => @delegate1.Invoke(A._)).MustHaveHappenedOnceExactly(); + A.CallTo(() => @delegate2.Invoke(A._)).MustHaveHappenedOnceExactly(); + A.CallTo(() => @delegate3.Invoke(A._)).MustHaveHappenedOnceExactly(); } [Fact] @@ -153,8 +153,8 @@ public void RegisterShouldCallConventionsAndDelegates() composer.Register(context); - A.CallTo(() => contribution.Register(A._)).MustHaveHappened(Repeated.Exactly.Once); - A.CallTo(() => @delegate.Invoke(A._)).MustHaveHappened(Repeated.Exactly.Once); + A.CallTo(() => contribution.Register(A._)).MustHaveHappenedOnceExactly(); + A.CallTo(() => @delegate.Invoke(A._)).MustHaveHappenedOnceExactly(); } } } diff --git a/test/Conventions.Tests/StaticConventionComposerTests.cs b/test/Conventions.Tests/StaticConventionComposerTests.cs index 6b280aa08..607d63ae8 100644 --- a/test/Conventions.Tests/StaticConventionComposerTests.cs +++ b/test/Conventions.Tests/StaticConventionComposerTests.cs @@ -27,7 +27,7 @@ public void RegisterShouldCallContribution() Composer.Register(scanner, context); - A.CallTo(() => contribution.Register(A._)).MustHaveHappened(Repeated.Exactly.Once); + A.CallTo(() => contribution.Register(A._)).MustHaveHappenedOnceExactly(); } [Fact] @@ -52,9 +52,9 @@ public void RegisterShouldCallContributions() Composer.Register(scanner, context); - A.CallTo(() => contribution1.Register(A._)).MustHaveHappened(Repeated.Exactly.Once); - A.CallTo(() => contribution2.Register(A._)).MustHaveHappened(Repeated.Exactly.Once); - A.CallTo(() => contribution3.Register(A._)).MustHaveHappened(Repeated.Exactly.Once); + A.CallTo(() => contribution1.Register(A._)).MustHaveHappenedOnceExactly(); + A.CallTo(() => contribution2.Register(A._)).MustHaveHappenedOnceExactly(); + A.CallTo(() => contribution3.Register(A._)).MustHaveHappenedOnceExactly(); } [Fact] @@ -72,7 +72,7 @@ public void RegisterShouldCallDelegate() Composer.Register(scanner, context); - A.CallTo(() => @delegate.Invoke(A._)).MustHaveHappened(Repeated.Exactly.Once); + A.CallTo(() => @delegate.Invoke(A._)).MustHaveHappenedOnceExactly(); } [Fact] @@ -95,9 +95,9 @@ public void RegisterShouldCallDelegates() Composer.Register(scanner, context); - A.CallTo(() => @delegate1.Invoke(A._)).MustHaveHappened(Repeated.Exactly.Once); - A.CallTo(() => @delegate2.Invoke(A._)).MustHaveHappened(Repeated.Exactly.Once); - A.CallTo(() => @delegate3.Invoke(A._)).MustHaveHappened(Repeated.Exactly.Once); + A.CallTo(() => @delegate1.Invoke(A._)).MustHaveHappenedOnceExactly(); + A.CallTo(() => @delegate2.Invoke(A._)).MustHaveHappenedOnceExactly(); + A.CallTo(() => @delegate3.Invoke(A._)).MustHaveHappenedOnceExactly(); } [Fact] @@ -118,8 +118,8 @@ public void RegisterShouldCallContributionsAndDelegates() Composer.Register(scanner, context); - A.CallTo(() => contribution.Register(A._)).MustHaveHappened(Repeated.Exactly.Once); - A.CallTo(() => @delegate.Invoke(A._)).MustHaveHappened(Repeated.Exactly.Once); + A.CallTo(() => contribution.Register(A._)).MustHaveHappenedOnceExactly(); + A.CallTo(() => @delegate.Invoke(A._)).MustHaveHappenedOnceExactly(); } } }