Added descriptions for all tests
All checks were successful
Nuget Pkg Build / build (push) Successful in 1m43s
All checks were successful
Nuget Pkg Build / build (push) Successful in 1m43s
This commit is contained in:
@@ -2,7 +2,7 @@ namespace Syrette.Tests;
|
||||
|
||||
public class ServiceContainerResolutionTests
|
||||
{
|
||||
[Fact]
|
||||
[Fact(DisplayName = "GetService<T> resolves a singleton registration")]
|
||||
public void GetService_T_resolves_singleton()
|
||||
{
|
||||
var container = new ServiceContainer();
|
||||
@@ -12,7 +12,7 @@ public class ServiceContainerResolutionTests
|
||||
Assert.IsType<TestServiceImpl>(instance);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Fact(DisplayName = "GetService<T> resolves a transient registration")]
|
||||
public void GetService_T_resolves_transient()
|
||||
{
|
||||
var container = new ServiceContainer();
|
||||
@@ -22,7 +22,7 @@ public class ServiceContainerResolutionTests
|
||||
Assert.IsType<TestServiceBImpl>(instance);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Fact(DisplayName = "Multiple GetService<T> calls for a singleton return the same instance")]
|
||||
public void Singleton_returns_same_instance()
|
||||
{
|
||||
var container = new ServiceContainer();
|
||||
@@ -32,7 +32,7 @@ public class ServiceContainerResolutionTests
|
||||
Assert.Same(a, b);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Fact(DisplayName = "Multiple GetService<T> calls for a transient return different instances")]
|
||||
public void Transient_returns_new_instance()
|
||||
{
|
||||
var container = new ServiceContainer();
|
||||
@@ -42,7 +42,7 @@ public class ServiceContainerResolutionTests
|
||||
Assert.NotSame(a, b);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Fact(DisplayName = "GetService(Type) non-generic overload resolves a registered service")]
|
||||
public void GetService_Type_non_generic_resolves()
|
||||
{
|
||||
var container = new ServiceContainer();
|
||||
@@ -52,7 +52,7 @@ public class ServiceContainerResolutionTests
|
||||
Assert.IsType<TestServiceImpl>(instance);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Fact(DisplayName = "GetService(Type, object[]) passes resolution-time args to the constructor")]
|
||||
public void GetService_Type_with_args_resolves()
|
||||
{
|
||||
var container = new ServiceContainer();
|
||||
@@ -61,7 +61,7 @@ public class ServiceContainerResolutionTests
|
||||
Assert.NotNull(instance);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Fact(DisplayName = "GetService<T> throws InvalidOperationException when type is not registered")]
|
||||
public void GetService_T_throws_for_unregistered()
|
||||
{
|
||||
var container = new ServiceContainer();
|
||||
@@ -69,7 +69,7 @@ public class ServiceContainerResolutionTests
|
||||
container.GetService<ITestService>());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Fact(DisplayName = "GetService(Type) throws InvalidOperationException when type is not registered")]
|
||||
public void GetService_Type_throws_for_unregistered()
|
||||
{
|
||||
var container = new ServiceContainer();
|
||||
@@ -77,7 +77,7 @@ public class ServiceContainerResolutionTests
|
||||
container.GetService(typeof(ITestService)));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Fact(DisplayName = "TryGetService(Type) returns null when type is not registered")]
|
||||
public void TryGetService_returns_null_for_unregistered()
|
||||
{
|
||||
var container = new ServiceContainer();
|
||||
@@ -85,7 +85,7 @@ public class ServiceContainerResolutionTests
|
||||
Assert.Null(result);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Fact(DisplayName = "TryGetService(Type) returns an instance when the type is registered")]
|
||||
public void TryGetService_returns_instance_when_registered()
|
||||
{
|
||||
var container = new ServiceContainer();
|
||||
@@ -94,7 +94,7 @@ public class ServiceContainerResolutionTests
|
||||
Assert.NotNull(result);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Fact(DisplayName = "Resolving by implementation type works when only the interface was registered")]
|
||||
public void Resolve_by_implementation_type_when_not_registered_directly()
|
||||
{
|
||||
var container = new ServiceContainer();
|
||||
@@ -103,7 +103,7 @@ public class ServiceContainerResolutionTests
|
||||
Assert.NotNull(instance);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Fact(DisplayName = "Resolution-time args override registration-time args of the same type")]
|
||||
public void Resolution_time_args_override_registration_time_args()
|
||||
{
|
||||
var container = new ServiceContainer();
|
||||
@@ -114,7 +114,7 @@ public class ServiceContainerResolutionTests
|
||||
Assert.NotEqual(Guid.Empty, deep.Id);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Fact(DisplayName = "GetServices<T> returns instances of all registered implementations for a service type")]
|
||||
public void GetServices_returns_all_registered_implementations()
|
||||
{
|
||||
var container = new ServiceContainer();
|
||||
@@ -127,7 +127,7 @@ public class ServiceContainerResolutionTests
|
||||
Assert.Contains(typeof(TestServiceAlt), types);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[Fact(DisplayName = "GetServiceTypes<T> returns the implementation types of all registered services")]
|
||||
public void GetServiceTypes_returns_all_implementation_types()
|
||||
{
|
||||
var container = new ServiceContainer();
|
||||
|
||||
Reference in New Issue
Block a user