Esempio n. 1
0
        public void ChangeActive_NewActiveValueGiven_ActiveChangedPassiveStaysSame(DestinationHealth oldActive, DestinationHealth newActive)
        {
            var compositeHealth = new CompositeDestinationHealth(DestinationHealth.Healthy, oldActive);

            compositeHealth = compositeHealth.ChangeActive(newActive);

            Assert.Equal(newActive, compositeHealth.Active);
            Assert.Equal(DestinationHealth.Healthy, compositeHealth.Passive);
        }
 public DestinationDynamicState(CompositeDestinationHealth health)
 {
     Health = health;
 }
Esempio n. 3
0
        public void Current_CalculatedAsBooleanOrOfActiveAndPassiveStates(DestinationHealth passive, DestinationHealth active, DestinationHealth expectedCurrent)
        {
            var compositeHealth = new CompositeDestinationHealth(passive, active);

            Assert.Equal(expectedCurrent, compositeHealth.Current);
        }