public void DetectsExcessiveDataAntiPattern_When_ThereIsOneQueryInTheTreeThatFetchesEagerlyAndEagerlyFetchedEntityIsNotUsed() { //Arrange ORMModelTreeGenerator ormModelTreeGenerator = new ORMModelTreeGenerator() .WithEagerLoadingDatabaseAccessingMethodCall(); //Act bool result = target.AppliesToModelTree(ormModelTreeGenerator.Tree); //Assert Assert.IsTrue(result); }
public void DetectsOneByOneProcessingAntiPattern_When_ThereIsOneQueryInTheTreeThatDoesLazyLoadingAndRelatedEntityIsUsedInALoop() { //Arrange var ormModelTreeGenerator = new ORMModelTreeGenerator() .WithLazyLoadingDatabaseAccessingMethodCall() .WithDatabaseEntityVariableAssignedByDatabaseAccessingMethodCall() .WithCallToRelatedEntityOnDatabaseEntityVariableAssignedByDatabaseAccessingMethodCall(); //Act bool result = target.AppliesToModelTree(ormModelTreeGenerator.Tree); //Assert Assert.IsTrue(result); }