mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-18 10:26:11 +08:00
initial version
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
namespace MQTTnet.Core.Tests
|
||||
{
|
||||
[TestClass]
|
||||
public class ServiceCollectionTest
|
||||
{
|
||||
[TestMethod]
|
||||
public void TestCanConstructAllServices()
|
||||
{
|
||||
var services = new ServiceCollection()
|
||||
.AddLogging()
|
||||
.AddMqttServer()
|
||||
.AddMqttClient();
|
||||
|
||||
var serviceProvider = services
|
||||
.BuildServiceProvider();
|
||||
|
||||
foreach (var service in services)
|
||||
{
|
||||
if (service.ServiceType.IsGenericType)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
serviceProvider.GetRequiredService(service.ServiceType);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user