Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup unit tests to remove ToList #369

Closed
AndyDentFree opened this issue Jan 20, 2016 · 1 comment
Closed

Cleanup unit tests to remove ToList #369

AndyDentFree opened this issue Jan 20, 2016 · 1 comment
Assignees
Labels
Milestone

Comments

@AndyDentFree
Copy link
Contributor

Before we had Count working on All and Where it was necessary to use ToList for our assertions. That can now be removed, which will cleanup and speedup our unit tests

@AndyDentFree
Copy link
Contributor Author

This is RC because it's actually an auditing activity for bits of LINQ syntax. It changes our tests to be testing more Linq.

AndyDentFree added a commit that referenced this issue Mar 4, 2016
#361 Add LINQ Count(Expression)

remove ToList and use straight All<...>()>Count()
- ObjectIntegrationTests.cs
  - SimpleTest
  - CreateObjectTest

remove ToList and use All<...>.Where(...).Count()
SimpelLINQtests.cs
- CreateList

replace  All<...>.Where(...).Count() with All<...>.Count(...)
SimpleLINQtests.cs
- CountFoundItems
- CountWithNot

replace realm.All<...>().Where( ...).ToList().First() with .All<...>().First(...)
- RelationshipTests.cs
  - TimHasATopDog
  - TimHasTwoIterableDogs
  - TimHasTwoIterableDogsListed
  - TimsIterableDogsThrowExceptions
  - TimRetiredHisTopDog
  - TimAddsADogLater
  - DaniHasNoTopDog

replace realm.All<...>().Where( ...).ToList().First() with .All<...>().Single(...)
- RelationshipTests.cs
  - TimAddsADogByInsert
  - TimLosesHisDogsByOrder
  - TimLosesHisDogsInOneClear
  - TimLosesBilbo
  - TestExceptionsFromTimsDogsOutOfRange

replace realm.All<...>().Where( ...).ToList()[0] with .All<...>().First(...)
- ObjectIntegrationTests.cs
  - ReadAndWriteEqualityTest

replace realm.All<...>().Where( ...).ToList().First() with .All<...>().Where(...).First()
- RelationshipTests.cs
  - DaniHasNoTopDog
  - TestExceptionsFromEmptyListOutOfRange

replace realm.All<...>().Where( ...).ToList().First() with .All<...>().Where(...).First()
- RelationshipTests.cs
  - DaniHasNoDogs
  - TestExceptionsFromIteratingEmptyList

replace realm.All<...>().Where( ...).ToList().Count with .All<...>().Count(...)
- TestManagingStandaloneThreeLevelRelationship
- TestCircularRelationshipsFromStandaloneTwoStage

RealmResultsVisitor.cs
- RecurseToWhereOrRunLambda added
- VisitMethodCall
  - handle Count, Single and First with no lambda argument, using RecurseToWhereOrRunLambda

TODO
NonAutomaticPropertiesShouldBeIgnored
_realm.All<Person>().ToList().Single() to straight
_realm.All<Person>().Single()
AndyDentFree added a commit that referenced this issue Mar 4, 2016
Added documentation
AndyDentFree added a commit that referenced this issue Mar 4, 2016
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants