Пример #1
0
        public void RepeatedlyResolvingAndRemovingMustBePossible(PooledContainer sut)
        {
            // Fixture setup
            sut.MaxSize = 1;

            // Exercise system
            Assert.DoesNotThrow(() =>
            {
                sut.Release(sut.ResolveProductManagementService());
                sut.Release(sut.ResolveProductManagementService());
                sut.Release(sut.ResolveProductManagementService());
            });
            // Verify outcome
            // Teardown
        }
Пример #2
0
        public void ResolvingServicesAndReleasingItAndThenResolvingTwiceShouldThrow(PooledContainer sut)
        {
            // Fixture setup
            sut.MaxSize = 1;

            var s = sut.ResolveProductManagementService();

            sut.Release(s);
            sut.ResolveProductManagementService();
            // Exercise system and verify outcome
            Assert.Throws <InvalidOperationException>(() => sut.ResolveProductManagementService());
            // Teardown
        }