public void Should_return_methods_from_entire_hierarchy() { //Given var child = new FakeChildDiagnosticsProvider(); var parent = new FakeParentDiagnosticsProvider(); IEnumerable <IDiagnosticsProvider> ie = new IDiagnosticsProvider[] { child, parent }; var id = new InteractiveDiagnostics(ie); var ad = id.AvailableDiagnostics; //When int methodsInParent = ad.ElementAt(1).Methods.Count(); int methodsInChild = ad.First().Methods.Count(); //Then Assert.True(methodsInChild == methodsInParent + 1); }
public void Should_return_methods_from_entire_hierarchy() { //Given var child = new FakeChildDiagnosticsProvider(); var parent = new FakeParentDiagnosticsProvider(); IEnumerable<IDiagnosticsProvider> ie = new IDiagnosticsProvider[] { child, parent }; var id = new InteractiveDiagnostics(ie); var ad = id.AvailableDiagnostics; //When int methodsInParent = ad.ElementAt(1).Methods.Count(); int methodsInChild = ad.First().Methods.Count(); //Then Assert.True(methodsInChild == methodsInParent + 1); }
public void Should_return_methods_from_entire_hierarchy() { //Given var child = new FakeChildDiagnosticsProvider(); var parent = new FakeParentDiagnosticsProvider(); var diagnostics = new InteractiveDiagnostics(new[] { child, parent }); var availableDiagnostics = diagnostics.AvailableDiagnostics.ToList(); //When var methodsInChild = availableDiagnostics[0].Methods.Count(); var methodsInParent = availableDiagnostics[1].Methods.Count(); //Then Assert.True(methodsInChild == methodsInParent + 1); }
public void Should_return_methods_from_entire_hierarchy() { //Given var child = new FakeChildDiagnosticsProvider(); var parent = new FakeParentDiagnosticsProvider(); var diagnostics = new InteractiveDiagnostics(new[] {child, parent}); var availableDiagnostics = diagnostics.AvailableDiagnostics.ToList(); //When var methodsInChild = availableDiagnostics[0].Methods.Count(); var methodsInParent = availableDiagnostics[1].Methods.Count(); //Then Assert.True(methodsInChild == methodsInParent + 1); }
public void Should_exclude_object_methods() { //Given var child = new FakeChildDiagnosticsProvider(); var diagnostics = new InteractiveDiagnostics(new[] { child }); var availableDiagnostics = diagnostics.AvailableDiagnostics.ToList(); var objectMethodNames = typeof(object).GetMethods() .Select(x => x.Name) .ToList(); //When var methodsInChild = availableDiagnostics[0].Methods; //Then foreach (var childMethod in methodsInChild) { Assert.DoesNotContain(childMethod.MethodName, objectMethodNames); } }
public void Should_exclude_object_methods() { //Given var child = new FakeChildDiagnosticsProvider(); var diagnostics = new InteractiveDiagnostics(new[] { child }); var availableDiagnostics = diagnostics.AvailableDiagnostics.ToList(); var objectMethodNames = typeof(object).GetMethods() .Select(x => x.Name) .ToList(); //When var methodsInChild = availableDiagnostics[0].Methods; //Then foreach (var childMethod in methodsInChild) { Assert.DoesNotContain(childMethod.MethodName, objectMethodNames); } }