public void TryGetService() { var algorithm = new TestAlgorithm(); Assert.IsTrue(algorithm.TryGetService(out TestService service)); Assert.IsInstanceOf <TestService>(service); Assert.IsFalse(algorithm.TryGetService <TestNotInService>(out _)); }