public void GetService_ServiceTypeIsNull_ThrowsArgumentNullException() { // arrange using var container = new Container(); var target = new SimpleInjectorServiceProviderAdapter(container); // act, assert Assert.Throws <ArgumentNullException>(() => target.GetService(null !)); }
public void GetService_ServiceTypeIsNotNull_ResolvesAndReturnsInstanceFromContainer() { // arrange using var container = new Container(); container.Register <SomeService>(); container.Register <SimpleInjectorServiceProviderAdapterTests>(); var target = new SimpleInjectorServiceProviderAdapter(container); // act var actual = target.GetService(typeof(SomeService)); // assert Assert.Equal(typeof(SomeService), actual.GetType()); }