public void NonAggregatableActionsReturnFalse() { var action1 = new ActionPropertyBag(_errorStore); var action2 = new ActionPropertyBag(_errorStore); Assert.IsFalse(ActionComparer.IsEquivalentClass(action1, action2)); }
public void DifferentPropertiesReturnFalse() { var action1 = new ActionPropertyBag(_errorStore); var action2 = new ActionPropertyBag(_errorStore); action1.IsAggregable = true; action2.IsAggregable = true; action1.Add(ActionPropertyNames.TenantIdConstStrKey, "TenantId"); Assert.IsFalse(ActionComparer.IsEquivalentClass(action1, action2)); }
public void SamePropertiesAndValuesReturnEquivalent() { var action1 = new ActionPropertyBag(_errorStore); var action2 = new ActionPropertyBag(_errorStore); action1.IsAggregable = true; action2.IsAggregable = true; action1.Add(ActionPropertyNames.TenantIdConstStrKey, "TenantId1"); action2.Add(ActionPropertyNames.TenantIdConstStrKey, "TenantId1"); Assert.IsTrue(ActionComparer.IsEquivalentClass(action1, action2)); }
private void SetMembers(IMenuFacade menu, HttpRequest req) { ActionContextFacade SetMenuId(ActionContextFacade action) { action.MenuId = menu.Id; return(action); } var actionFacades = menu.MenuItems.SelectMany(i => GetMenuItem(i)).Where(af => IsVisibleAndUsable(af.action)).ToArray(); var actions = actionFacades.Select(a => InlineActionRepresentation.Create(OidStrategy, req, SetMenuId(a.action), Flags)).ToArray(); var actionComparer = new ActionComparer(); actions = actions.Distinct(actionComparer).ToArray(); Members = RestUtils.CreateMap(actions.ToDictionary(m => m.Id, m => (object)m)); }
/// <summary> /// Creates a new ActionManager instance. /// </summary> public ActionManager() { _comparer = new ActionComparer(); _actions = new List<Action>(); _active = new List<Action>(); }