public void Ignores_duplicate_request_type() { var cache = new MethodMatchEvaluationCache(); var evaluation = new MethodMatchEvaluation(typeof(SomeRequest), null, Array.Empty <MethodInfo>()); _ = cache.TryAdd(evaluation); bool added = cache.TryAdd(evaluation); Assert.False(added); }
public void Accepts_request_type() { var cache = new MethodMatchEvaluationCache(); bool added = cache.TryAdd(new MethodMatchEvaluation(typeof(SomeRequest), null, Array.Empty <MethodInfo>())); Assert.True(added); }
public void Finds_request_type() { var cache = new MethodMatchEvaluationCache(); var evaluation = new MethodMatchEvaluation(typeof(SomeRequest), null, Array.Empty <MethodInfo>()); _ = cache.TryAdd(evaluation); bool found = cache.TryFindEvaluation(typeof(SomeRequest), out var cached); Assert.True(found); Assert.Same(evaluation, cached); }
public void Accepts_empty_methods() { var cache = new MethodMatchEvaluationCache(); cache.TryAdd(new MethodMatchEvaluation(typeof(SomeRequest), typeof(SomeResponse), methods: Array.Empty <MethodInfo>())); }