public void GetService_Throws() { var algorithm = new TestAlgorithm(); // ReSharper disable ReturnValueOfPureMethodIsNotUsed Assert.Throws <ArgumentNullException>(() => algorithm.GetService <TestNullService>()); Assert.Throws <InvalidOperationException>(() => algorithm.GetService <TestNotInService>()); // ReSharper restore ReturnValueOfPureMethodIsNotUsed }
public void GetService() { var algorithm = new TestAlgorithm(); var service = algorithm.GetService <TestService>(); Assert.IsInstanceOf <TestService>(service); }