Exemplo n.º 1
0
        public void StrategyStartsInstanceIfItIsStartable()
        {
            var instance = new StartableObject();
            var reference = new InstanceReference { Instance = instance };

            strategy.Activate(contextMock.Object, reference);
            instance.WasStarted.Should().BeTrue();
        }
Exemplo n.º 2
0
        public void StrategyStartsInstanceIfItIsStartable()
        {
            var instance = new StartableObject();

            contextMock.SetupGet(x => x.Instance).Returns(instance);
            strategy.Activate(contextMock.Object);

            instance.WasStarted.ShouldBeTrue();
        }
Exemplo n.º 3
0
        public void StrategyStartsInstanceIfItIsStartable()
        {
            var instance  = new StartableObject();
            var reference = new InstanceReference {
                Instance = instance
            };

            this.strategy.Activate(this.contextMock.Object, reference);
            instance.WasStarted.Should().BeTrue();
        }
Exemplo n.º 4
0
        public void StrategyStopsInstanceIfItIsStartable()
        {
            var instance  = new StartableObject();
            var reference = new InstanceReference {
                Instance = instance
            };

            strategy.Deactivate(contextMock.Object, reference);

            instance.WasStopped.Should().BeTrue();
        }