Beispiel #1
0
 //handlers which apply the results of the domainy things
 private void Apply(ToggleCreated e)
 {
     ID            = e.NewToggleID;
     Name          = e.Name;
     Description   = e.Description;
     ConditionMode = ConditionModes.All;
 }
Beispiel #2
0
 public void Apply(ToggleCreated e)
 {
     ID            = e.NewToggleID;
     Name          = e.Name;
     Description   = e.Description;
     ConditionMode = e.ConditionMode;
 }
Beispiel #3
0
 public ToggleCreated(EditorID creator, ToggleID newToggleID, string name, string description, ConditionModes conditionMode)
 {
     NewToggleID   = newToggleID;
     Creator       = creator;
     Name          = name;
     Description   = description;
     ConditionMode = conditionMode;
 }
Beispiel #4
0
        public void ConditionMode_effects_active_check(ConditionModes mode, int left, int right, bool expected)
        {
            var toggle = new Toggle
            {
                ConditionMode = mode,
                Conditions    = new[]
                {
                    left == 1 ? new EnabledCondition() : new DisabledCondition() as Condition,
                    right == 1 ? new EnabledCondition() : new DisabledCondition() as Condition
                }
            };

            toggle
            .IsActive(Substitute.For <IStatisticsWriter>(), Substitute.For <IToggleContext>())
            .ShouldBe(expected);
        }
Beispiel #5
0
 public void Apply(EnabledOnAnyCondition e) => ConditionMode  = ConditionModes.Any;
Beispiel #6
0
 public void Apply(EnabledOnAllConditions e) => ConditionMode = ConditionModes.All;
Beispiel #7
0
 public ChangeConditionModeRequest(EditorID editor, ToggleLocator locator, ConditionModes mode)
 {
     Editor  = editor;
     Locator = locator;
     Mode    = mode;
 }
Beispiel #8
0
 private void Apply(EnabledOnAnyCondition e) => ConditionMode  = ConditionModes.Any;
Beispiel #9
0
 private void Apply(EnabledOnAllConditions e) => ConditionMode = ConditionModes.All;