public void FindIndex_GuardClauses() { // Arrange var config = new ProcessorConfiguration(); var defaultServices = new DefaultServices(config); // Act & assert ExceptionAssert.ThrowsArgumentNull(() => defaultServices.FindIndex(serviceType: null, match: _ => true), "serviceType"); ExceptionAssert.ThrowsArgumentNull(() => defaultServices.FindIndex(typeof(object), match: null), "match"); ExceptionAssert.ThrowsArgument(() => defaultServices.FindIndex(typeof(object), _ => true), "serviceType"); }
public void FindIndex_FailedFind() { // Arrange var config = new ProcessorConfiguration(); var defaultServices = new DefaultServices(config); // Act int index = defaultServices.FindIndex(typeof(IFilterProvider), _ => false); // Assert Assert.Equal(-1, index); }
public void FindIndex_EmptyServiceListAlwaysReturnsFailure() { // Arrange var config = new ProcessorConfiguration(); var defaultServices = new DefaultServices(config); defaultServices.Clear(typeof(IFilterProvider)); // Act int index = defaultServices.FindIndex(typeof(IFilterProvider), _ => true); // Assert Assert.Equal(-1, index); }