Skip to content

Commit 325b081

Browse files
committed
Change: Rename ServiceKey references to ServiceType
1 parent c1b876a commit 325b081

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

src/CodeOfChaos.Testing.TUnit/Conditions/Library/ContainsServiceKeyCondition.cs renamed to src/CodeOfChaos.Testing.TUnit/Conditions/Library/ContainsServiceTypeCondition.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace CodeOfChaos.Testing.TUnit.Conditions.Library;
88
// ---------------------------------------------------------------------------------------------------------------------
99
// Code
1010
// ---------------------------------------------------------------------------------------------------------------------
11-
public class ContainsServiceKeyCondition<TServiceKey> : BaseAssertCondition<ServiceCollection> {
11+
public class ContainsServiceTypeCondition<TServiceKey> : BaseAssertCondition<ServiceCollection> {
1212
// -----------------------------------------------------------------------------------------------------------------
1313
// Methods
1414
// -----------------------------------------------------------------------------------------------------------------

src/CodeOfChaos.Testing.TUnit/Conditions/Library/DoesNotContainServiceKeyCondition.cs renamed to src/CodeOfChaos.Testing.TUnit/Conditions/Library/DoesNotContainServiceTypeCondition.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace CodeOfChaos.Testing.TUnit.Conditions.Library;
88
// ---------------------------------------------------------------------------------------------------------------------
99
// Code
1010
// ---------------------------------------------------------------------------------------------------------------------
11-
public class DoesNotContainServiceKeyCondition<TServiceKey> : BaseAssertCondition<ServiceCollection> {
11+
public class DoesNotContainServiceTypeCondition<TServiceKey> : BaseAssertCondition<ServiceCollection> {
1212
// -----------------------------------------------------------------------------------------------------------------
1313
// Methods
1414
// -----------------------------------------------------------------------------------------------------------------

src/CodeOfChaos.Testing.TUnit/Extensions/TUnitExtensionsServiceCollection.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ namespace CodeOfChaos.Testing.TUnit;
1313
// ---------------------------------------------------------------------------------------------------------------------
1414
// ReSharper disable once InconsistentNaming
1515
public static class TUnitExtensionsServiceCollection {
16-
public static InvokableValueAssertionBuilder<ServiceCollection> ContainsServiceKey<TServiceKey>(this IValueSource<ServiceCollection> valueSource, [CallerArgumentExpression(nameof(valueSource))] string doNotPopulateThisValue1 = "") {
16+
public static InvokableValueAssertionBuilder<ServiceCollection> ContainsServiceType<TServiceType>(this IValueSource<ServiceCollection> valueSource, [CallerArgumentExpression(nameof(valueSource))] string doNotPopulateThisValue1 = "") {
1717
return valueSource.RegisterAssertion(
18-
new ContainsServiceKeyCondition<TServiceKey>(),
18+
new ContainsServiceTypeCondition<TServiceType>(),
1919
[doNotPopulateThisValue1]
2020
);
2121
}
2222

23-
public static InvokableValueAssertionBuilder<ServiceCollection> DoesNotContainServiceKey<TServiceKey>(this IValueSource<ServiceCollection> valueSource, [CallerArgumentExpression(nameof(valueSource))] string doNotPopulateThisValue1 = "") {
23+
public static InvokableValueAssertionBuilder<ServiceCollection> DoesNotContainServiceType<TServiceType>(this IValueSource<ServiceCollection> valueSource, [CallerArgumentExpression(nameof(valueSource))] string doNotPopulateThisValue1 = "") {
2424
return valueSource.RegisterAssertion(
25-
new DoesNotContainServiceKeyCondition<TServiceKey>(),
25+
new DoesNotContainServiceTypeCondition<TServiceType>(),
2626
[doNotPopulateThisValue1]
2727
);
2828
}

tests/Tests.CodeOfChaos.Testing.TUnit/TUnitExtensionsServiceCollectionTests.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,50 +12,50 @@ namespace Tests.CodeOfChaos.Testing.TUnit;
1212
// ---------------------------------------------------------------------------------------------------------------------
1313
public class TUnitExtensionsServiceCollectionTests {
1414
[Test]
15-
public async Task ContainsServiceKey_ShouldAssert() {
15+
public async Task ContainsServiceType_ShouldAssert() {
1616
// Arrange
1717
var services = new ServiceCollection();
1818

1919
// Act
2020
services.AddSingleton<string, string>();
2121

2222
// Assert
23-
await Assert.That(services).ContainsServiceKey<string>();
23+
await Assert.That(services).ContainsServiceType<string>();
2424
}
2525

2626
[Test]
27-
public async Task ContainsServiceKey_ShouldThrowAssertion() {
27+
public async Task ContainsServiceType_ShouldThrowAssertion() {
2828
// Arrange
2929
var services = new ServiceCollection();
3030

3131
// Act
3232
services.AddSingleton<string, string>();
3333

3434
// Assert
35-
await Assert.ThrowsAsync<AssertionException>(async () => await Assert.That(services).ContainsServiceKey<int>());
35+
await Assert.ThrowsAsync<AssertionException>(async () => await Assert.That(services).ContainsServiceType<int>());
3636
}
3737

3838
[Test]
39-
public async Task DoesNotContainServiceKey_ShouldAssert() {
39+
public async Task DoesNotContainServiceType_ShouldAssert() {
4040
// Arrange
4141
var services = new ServiceCollection();
4242

4343
// Act
4444
services.AddSingleton<string, string>();
4545

4646
// Assert
47-
await Assert.That(services).DoesNotContainServiceKey<int>();
47+
await Assert.That(services).DoesNotContainServiceType<int>();
4848
}
4949

5050
[Test]
51-
public async Task DoesNotContainServiceKey_ShouldThrowAssertion() {
51+
public async Task DoesNotContainServiceType_ShouldThrowAssertion() {
5252
// Arrange
5353
var services = new ServiceCollection();
5454

5555
// Act
5656
services.AddSingleton<string, string>();
5757

5858
// Assert
59-
await Assert.ThrowsAsync<AssertionException>(async () => await Assert.That(services).DoesNotContainServiceKey<string>());
59+
await Assert.ThrowsAsync<AssertionException>(async () => await Assert.That(services).DoesNotContainServiceType<string>());
6060
}
6161
}

0 commit comments

Comments
 (0)