public void then_get_related_elements_returns_children_of_policy() { var policy = ElementsFromType <ExceptionPolicyData>().First(); var relatedelements = sectionViewModel.GetRelatedElements(policy); CollectionAssert.IsSubsetOf( policy.ChildElements.SelectMany(x => x.ChildElements).ToArray(), relatedelements.ToArray()); }
public void then_trace_sources_have_listeners_as_related_elements() { var traceSources = loggingViewModel.GetDescendentsOfType <TraceSourceData>(); foreach (var source in traceSources) { foreach (var listener in source.GetDescendentsOfType <TraceListenerReferenceData>()) { var thisListener = listener; Assert.IsTrue(loggingViewModel.GetRelatedElements(source) .Where(x => x.Name == listener.Name && typeof(TraceListenerData).IsAssignableFrom(x.ConfigurationType)) .Any()); } } }
protected override void Act() { var tracelistener = sectionViewModel.GetDescendentsOfType <FormattedEventLogTraceListenerData>().First(); relatedElements = sectionViewModel.GetRelatedElements(tracelistener); }