public void AddDataLoader_Services_ServicesIsNull() { // arrange // act Action action = () => DataLoaderServiceCollectionExtensions.AddDataLoader <TestDataLoader>(null); // assert Assert.Throws <ArgumentNullException>(action); }
public void AddDataLoader_ServicesFactory_FactoryIsNull() { // arrange var services = new ServiceCollection(); // act Action action = () => DataLoaderServiceCollectionExtensions.AddDataLoader <TestDataLoader>( services, null); // assert Assert.Throws <ArgumentNullException>(action); }
public void AddDataLoader_Services() { // arrange var services = new ServiceCollection(); // act DataLoaderServiceCollectionExtensions.AddDataLoader <TestDataLoader>(services); // assert services .Select(t => t.ServiceType.GetTypeName()) .OrderBy(t => t) .ToArray() .MatchSnapshot(); }
public void AddDataLoader_ServicesFactory_ServiceToImplementation_MultipleTimes() { // arrange var services = new ServiceCollection(); // act DataLoaderServiceCollectionExtensions .AddDataLoader <ITestDataLoader, TestDataLoader>(services); DataLoaderServiceCollectionExtensions .AddDataLoader <ITestDataLoader, TestDataLoader>(services); DataLoaderServiceCollectionExtensions .AddDataLoader <ITestDataLoader, TestDataLoader>(services); // assert services .Select(t => t.ServiceType.GetTypeName()) .OrderBy(t => t) .ToArray() .MatchSnapshot(); }