public async Task Null_Message_should_raise_null_guard() { var ruleCollectionMock = new Mock <RuleCollection <TestMessage> >(); var sp = new Mock <ServiceProviderDelegate>(); var sut = new FluentHybridRuleEngine <TestMessage>(ruleCollectionMock.Object, sp.Object); await Assert.ThrowsAsync <ArgumentNullException>(async() => await sut.ValidateAsync(null !).ConfigureAwait(false)) .ConfigureAwait(false); }
public RuleCollectionTester(TCollection collection, Dictionary <Type, object> objectMap) { object Creator(Type type) { if (objectMap.ContainsKey(type)) { return(objectMap[type]); } throw new InvalidOperationException("Unknown type in objectmap"); } _engine = new FluentHybridRuleEngine <T>(collection, Creator); }
public RuleCollectionTester(TCollection collection) { _engine = new FluentHybridRuleEngine <T>(collection, ServiceProviderDelegate); }