public void AlwayRejectevaluatorReturnsFalse() { // Setup var logger = _loggerFactory.CreateLogger <AlwaysRejectEvaluator>(); var testUser = new User(); var evaluator = new AlwaysRejectEvaluator(logger); // Act var result = evaluator.CanUserBeDeleted(testUser); // Assert Assert.False(result); }
public void AggregateEvaluatorRejectsDuplicateEvalutors() { // Setup var aaeLogger = _loggerFactory.CreateLogger <AlwaysAllowEvaluator>(); var areLogger = _loggerFactory.CreateLogger <AlwaysRejectEvaluator>(); var aeLogger = _loggerFactory.CreateLogger <AggregateEvaluator>(); var evaluator1 = new AlwaysAllowEvaluator(aaeLogger); var evaluator2 = new AlwaysRejectEvaluator(areLogger); var aggregateEvalutor = new AggregateEvaluator(aeLogger); // Act var result1 = aggregateEvalutor.AddEvaluator(evaluator1); var result2 = aggregateEvalutor.AddEvaluator(evaluator1); var result3 = aggregateEvalutor.AddEvaluator(evaluator2); // Assert Assert.True(result1); Assert.False(result2); Assert.True(result3); }
public void AggregateEvaluatorRejectsIfAnyRejects() { // Setup var aaeLogger = _loggerFactory.CreateLogger <AlwaysAllowEvaluator>(); var areLogger = _loggerFactory.CreateLogger <AlwaysRejectEvaluator>(); var aeLogger = _loggerFactory.CreateLogger <AggregateEvaluator>(); var testUser = new User(); var evaluator1 = new AlwaysAllowEvaluator(aaeLogger); var evaluator2 = new AlwaysRejectEvaluator(areLogger); var aggregateEvalutor = new AggregateEvaluator(aeLogger); aggregateEvalutor.AddEvaluator(evaluator1); aggregateEvalutor.AddEvaluator(evaluator2); // Act var result = aggregateEvalutor.CanUserBeDeleted(testUser); // Assert Assert.False(result); }