예제 #1
0
        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
        }
예제 #2
0
        public void GetService()
        {
            var algorithm = new TestAlgorithm();
            var service   = algorithm.GetService <TestService>();

            Assert.IsInstanceOf <TestService>(service);
        }