Skip to content

Commit

Permalink
Fixed fake it easy changes
Browse files Browse the repository at this point in the history
  • Loading branch information
david-driscoll committed Jan 13, 2019
1 parent bbbac7e commit 8503a6f
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 30 deletions.
12 changes: 6 additions & 6 deletions test/Conventions.Tests/ConventionScannerExtensionsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public void ShouldAddConvention_WithParams()

scanner.PrependConvention(convention1, convention2, convention3);

A.CallTo(() => scanner.PrependConvention(A<IConvention>._)).MustHaveHappened(Repeated.Exactly.Times(3));
A.CallTo(() => scanner.PrependConvention(A<IConvention>._)).MustHaveHappened(3, Times.Exactly);
}

[Fact]
Expand All @@ -32,7 +32,7 @@ public void ShouldAddConvention_WithEnumerable()

scanner.PrependConvention(new[] { convention1, convention2, convention3 }.AsEnumerable());

A.CallTo(() => scanner.PrependConvention(A<IConvention>._)).MustHaveHappened(Repeated.Exactly.Times(3));
A.CallTo(() => scanner.PrependConvention(A<IConvention>._)).MustHaveHappened(3, Times.Exactly);
}

[Fact]
Expand All @@ -45,7 +45,7 @@ public void ShouldAddConventionDelegate_WithParams()

scanner.PrependDelegate(d1, d2, d3);

A.CallTo(() => scanner.PrependDelegate(A<Delegate>._)).MustHaveHappened(Repeated.Exactly.Times(3));
A.CallTo(() => scanner.PrependDelegate(A<Delegate>._)).MustHaveHappened(3, Times.Exactly);
}

[Fact]
Expand All @@ -58,7 +58,7 @@ public void ShouldAddConventionDelegate_WithEnumerable()

scanner.PrependDelegate(new[] { d1, d2, d3 }.AsEnumerable());

A.CallTo(() => scanner.PrependDelegate(A<Delegate>._)).MustHaveHappened(Repeated.Exactly.Times(3));
A.CallTo(() => scanner.PrependDelegate(A<Delegate>._)).MustHaveHappened(3, Times.Exactly);
}

[Fact]
Expand All @@ -71,7 +71,7 @@ public void ShouldExcludeConvention_WithParams()

scanner.ExceptConvention(d1, d2, d3);

A.CallTo(() => scanner.ExceptConvention(A<Type>._)).MustHaveHappened(Repeated.Exactly.Times(3));
A.CallTo(() => scanner.ExceptConvention(A<Type>._)).MustHaveHappened(3, Times.Exactly);
}

[Fact]
Expand All @@ -84,7 +84,7 @@ public void ShouldExcludeConvention_WithEnumerable()

scanner.ExceptConvention(new[] { d1, d2, d3 }.AsEnumerable());

A.CallTo(() => scanner.ExceptConvention(A<Type>._)).MustHaveHappened(Repeated.Exactly.Times(3));
A.CallTo(() => scanner.ExceptConvention(A<Type>._)).MustHaveHappened(3, Times.Exactly);
}
}
}
8 changes: 4 additions & 4 deletions test/Conventions.Tests/ConventionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ public void ComposerCallsValuesAsExpected()

composer.Register(new ServiceConventionContext(Logger));
composer.Register(new ServiceConventionContext(Logger));
A.CallTo(() => dele.Invoke(A<ServiceConventionContext>._)).MustHaveHappened(Repeated.Exactly.Twice);
A.CallTo(() => dele2.Invoke(A<ServiceConventionContext>._)).MustHaveHappened(Repeated.Exactly.Twice);
A.CallTo(() => contrib.Register(A<ServiceConventionContext>._)).MustHaveHappened(Repeated.Exactly.Twice);
A.CallTo(() => contrib2.Register(A<ServiceConventionContext>._)).MustHaveHappened(Repeated.Exactly.Twice);
A.CallTo(() => dele.Invoke(A<ServiceConventionContext>._)).MustHaveHappenedTwiceExactly();
A.CallTo(() => dele2.Invoke(A<ServiceConventionContext>._)).MustHaveHappenedTwiceExactly();
A.CallTo(() => contrib.Register(A<ServiceConventionContext>._)).MustHaveHappenedTwiceExactly();
A.CallTo(() => contrib2.Register(A<ServiceConventionContext>._)).MustHaveHappenedTwiceExactly();
}
}
}
20 changes: 10 additions & 10 deletions test/Conventions.Tests/GenericConventionComposerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public void RegisterShouldCallConvention()

composer.Register(context);

A.CallTo(() => contribution.Register(A<ITestConventionContext>._)).MustHaveHappened(Repeated.Exactly.Once);
A.CallTo(() => contribution.Register(A<ITestConventionContext>._)).MustHaveHappenedOnceExactly();
}

[Fact]
Expand All @@ -78,9 +78,9 @@ public void RegisterShouldCallConventions()

composer.Register(context);

A.CallTo(() => contribution1.Register(A<ITestConventionContext>._)).MustHaveHappened(Repeated.Exactly.Once);
A.CallTo(() => contribution2.Register(A<ITestConventionContext>._)).MustHaveHappened(Repeated.Exactly.Once);
A.CallTo(() => contribution3.Register(A<ITestConventionContext>._)).MustHaveHappened(Repeated.Exactly.Once);
A.CallTo(() => contribution1.Register(A<ITestConventionContext>._)).MustHaveHappenedOnceExactly();
A.CallTo(() => contribution2.Register(A<ITestConventionContext>._)).MustHaveHappenedOnceExactly();
A.CallTo(() => contribution3.Register(A<ITestConventionContext>._)).MustHaveHappenedOnceExactly();
}

[Fact]
Expand All @@ -100,7 +100,7 @@ public void RegisterShouldCallDelegate()

composer.Register(context);

A.CallTo(() => @delegate.Invoke(A<ITestConventionContext>._)).MustHaveHappened(Repeated.Exactly.Once);
A.CallTo(() => @delegate.Invoke(A<ITestConventionContext>._)).MustHaveHappenedOnceExactly();
}

[Fact]
Expand All @@ -127,9 +127,9 @@ public void RegisterShouldCallDelegates()

composer.Register(context);

A.CallTo(() => @delegate1.Invoke(A<ITestConventionContext>._)).MustHaveHappened(Repeated.Exactly.Once);
A.CallTo(() => @delegate2.Invoke(A<ITestConventionContext>._)).MustHaveHappened(Repeated.Exactly.Once);
A.CallTo(() => @delegate3.Invoke(A<ITestConventionContext>._)).MustHaveHappened(Repeated.Exactly.Once);
A.CallTo(() => @delegate1.Invoke(A<ITestConventionContext>._)).MustHaveHappenedOnceExactly();
A.CallTo(() => @delegate2.Invoke(A<ITestConventionContext>._)).MustHaveHappenedOnceExactly();
A.CallTo(() => @delegate3.Invoke(A<ITestConventionContext>._)).MustHaveHappenedOnceExactly();
}

[Fact]
Expand All @@ -153,8 +153,8 @@ public void RegisterShouldCallConventionsAndDelegates()

composer.Register(context);

A.CallTo(() => contribution.Register(A<ITestConventionContext>._)).MustHaveHappened(Repeated.Exactly.Once);
A.CallTo(() => @delegate.Invoke(A<ITestConventionContext>._)).MustHaveHappened(Repeated.Exactly.Once);
A.CallTo(() => contribution.Register(A<ITestConventionContext>._)).MustHaveHappenedOnceExactly();
A.CallTo(() => @delegate.Invoke(A<ITestConventionContext>._)).MustHaveHappenedOnceExactly();
}
}
}
20 changes: 10 additions & 10 deletions test/Conventions.Tests/StaticConventionComposerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public void RegisterShouldCallContribution()

Composer.Register<ITestConventionContext, ITestConvention, TestContributionDelegate>(scanner, context);

A.CallTo(() => contribution.Register(A<ITestConventionContext>._)).MustHaveHappened(Repeated.Exactly.Once);
A.CallTo(() => contribution.Register(A<ITestConventionContext>._)).MustHaveHappenedOnceExactly();
}

[Fact]
Expand All @@ -52,9 +52,9 @@ public void RegisterShouldCallContributions()

Composer.Register<ITestConventionContext, ITestConvention, TestContributionDelegate>(scanner, context);

A.CallTo(() => contribution1.Register(A<ITestConventionContext>._)).MustHaveHappened(Repeated.Exactly.Once);
A.CallTo(() => contribution2.Register(A<ITestConventionContext>._)).MustHaveHappened(Repeated.Exactly.Once);
A.CallTo(() => contribution3.Register(A<ITestConventionContext>._)).MustHaveHappened(Repeated.Exactly.Once);
A.CallTo(() => contribution1.Register(A<ITestConventionContext>._)).MustHaveHappenedOnceExactly();
A.CallTo(() => contribution2.Register(A<ITestConventionContext>._)).MustHaveHappenedOnceExactly();
A.CallTo(() => contribution3.Register(A<ITestConventionContext>._)).MustHaveHappenedOnceExactly();
}

[Fact]
Expand All @@ -72,7 +72,7 @@ public void RegisterShouldCallDelegate()

Composer.Register<ITestConventionContext, ITestConvention, TestContributionDelegate>(scanner, context);

A.CallTo(() => @delegate.Invoke(A<ITestConventionContext>._)).MustHaveHappened(Repeated.Exactly.Once);
A.CallTo(() => @delegate.Invoke(A<ITestConventionContext>._)).MustHaveHappenedOnceExactly();
}

[Fact]
Expand All @@ -95,9 +95,9 @@ public void RegisterShouldCallDelegates()

Composer.Register<ITestConventionContext, ITestConvention, TestContributionDelegate>(scanner, context);

A.CallTo(() => @delegate1.Invoke(A<ITestConventionContext>._)).MustHaveHappened(Repeated.Exactly.Once);
A.CallTo(() => @delegate2.Invoke(A<ITestConventionContext>._)).MustHaveHappened(Repeated.Exactly.Once);
A.CallTo(() => @delegate3.Invoke(A<ITestConventionContext>._)).MustHaveHappened(Repeated.Exactly.Once);
A.CallTo(() => @delegate1.Invoke(A<ITestConventionContext>._)).MustHaveHappenedOnceExactly();
A.CallTo(() => @delegate2.Invoke(A<ITestConventionContext>._)).MustHaveHappenedOnceExactly();
A.CallTo(() => @delegate3.Invoke(A<ITestConventionContext>._)).MustHaveHappenedOnceExactly();
}

[Fact]
Expand All @@ -118,8 +118,8 @@ public void RegisterShouldCallContributionsAndDelegates()

Composer.Register<ITestConventionContext, ITestConvention, TestContributionDelegate>(scanner, context);

A.CallTo(() => contribution.Register(A<ITestConventionContext>._)).MustHaveHappened(Repeated.Exactly.Once);
A.CallTo(() => @delegate.Invoke(A<ITestConventionContext>._)).MustHaveHappened(Repeated.Exactly.Once);
A.CallTo(() => contribution.Register(A<ITestConventionContext>._)).MustHaveHappenedOnceExactly();
A.CallTo(() => @delegate.Invoke(A<ITestConventionContext>._)).MustHaveHappenedOnceExactly();
}
}
}

0 comments on commit 8503a6f

Please sign in to comment.