Skip to content

Commit

Permalink
refactor(xunit)!: Renamed TestOperatorFixture --> OperatorFixture
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusbooyah committed Apr 23, 2024
1 parent c8d833d commit 771a79b
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// FILE: TestOperatorFixture.cs
// FILE: OperatorFixture.cs
// CONTRIBUTOR: Marcus Bowyer
// COPYRIGHT: Copyright © 2005-2024 by NEONFORGE LLC. All rights reserved.
//
Expand Down Expand Up @@ -33,7 +33,7 @@ namespace Neon.Operator.Xunit
/// <summary>
/// A test fixture used for testing Kubernetes Operators.
/// </summary>
public class TestOperatorFixture : TestFixture
public class OperatorFixture : TestFixture
{
/// <summary>
/// The services collection.
Expand All @@ -45,7 +45,7 @@ public class TestOperatorFixture : TestFixture
/// <summary>
/// Constructor.
/// </summary>
public TestOperatorFixture()
public OperatorFixture()
{
this.testApiServerHost = new TestApiServerBuilder().Build();
this.KubernetesClientConfiguration = KubernetesClientConfiguration.BuildConfigFromConfigObject(testApiServerHost.KubeConfig);
Expand Down
4 changes: 2 additions & 2 deletions src/Neon.Operator.Xunit/TypeNotRegisteredException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class TypeNotRegisteredException : Exception
/// <param name="plural">The plural form of the type.</param>
public TypeNotRegisteredException(string group, string version, string plural)
: base($"There is no type registered for {group}/{version}/{plural}. " +
$"Register the type by calling TestOperatorFixture.RegisterType<T>() in your unit test.")
$"Register the type by calling OperatorFixture.RegisterType<T>() in your unit test.")
{

}
Expand All @@ -49,7 +49,7 @@ public TypeNotRegisteredException(string group, string version, string plural)
/// <param name="plural">The plural form of the type.</param>
public TypeNotRegisteredException(string version, string plural)
: base($"There is no type registered for {version}/{plural}. " +
$"Register the type by calling TestOperatorFixture.RegisterType<T>() in your unit test.")
$"Register the type by calling OperatorFixture.RegisterType<T>() in your unit test.")
{

}
Expand Down
6 changes: 3 additions & 3 deletions test/Test.Kubernetes/Test_Kubernetes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
namespace TestKubernetes
{
[Trait(TestTrait.Category, TestArea.NeonOperator)]
public class Test_Kubernetes : IClassFixture<TestOperatorFixture>
public class Test_Kubernetes : IClassFixture<OperatorFixture>
{
private TestOperatorFixture fixture;
private OperatorFixture fixture;

public Test_Kubernetes(TestOperatorFixture fixture)
public Test_Kubernetes(OperatorFixture fixture)
{
this.fixture = fixture;
fixture.RegisterType<V1Certificate>();
Expand Down
6 changes: 3 additions & 3 deletions test/Test.Neon.Operator/TestCoreResources.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@
namespace TestKubeOperator
{
[Trait(TestTrait.Category, TestArea.NeonOperator)]
public class TestCoreResources : IClassFixture<TestOperatorFixture>
public class TestCoreResources : IClassFixture<OperatorFixture>
{
private TestOperatorFixture fixture;
private OperatorFixture fixture;

public TestCoreResources(TestOperatorFixture fixture)
public TestCoreResources(OperatorFixture fixture)
{
this.fixture = fixture;
fixture.RegisterType<V1ConfigMap>();
Expand Down
6 changes: 3 additions & 3 deletions test/Test.Neon.Operator/Test_DependencyInjection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ public override async Task<ResourceControllerResult> ReconcileAsync(V1TestResour
}

[Trait(TestTrait.Category, TestArea.NeonOperator)]
public class Test_DependencyInjection : IClassFixture<TestOperatorFixture>, IDisposable
public class Test_DependencyInjection : IClassFixture<OperatorFixture>, IDisposable
{
private TestOperatorFixture fixture;
private OperatorFixture fixture;

public Test_DependencyInjection(TestOperatorFixture fixture)
public Test_DependencyInjection(OperatorFixture fixture)
{
this.fixture = fixture;
this.fixture.Services.AddSingleton<Foo>(new Foo("bar"));
Expand Down
6 changes: 3 additions & 3 deletions test/Test.Neon.Operator/Test_Operator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@
namespace Test.Neon.Operator
{
[Trait(TestTrait.Category, TestArea.NeonOperator)]
public class TestOperator : IClassFixture<TestOperatorFixture>
public class TestOperator : IClassFixture<OperatorFixture>
{
private TestOperatorFixture fixture;
private OperatorFixture fixture;

public TestOperator(TestOperatorFixture fixture)
public TestOperator(OperatorFixture fixture)
{
this.fixture = fixture;
fixture.Operator.AddController<TestResourceController>();
Expand Down

0 comments on commit 771a79b

Please sign in to comment.