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

Update integration test to verify ID uniqueness of TesTasks in the DB #204

Merged
merged 3 commits into from
Apr 25, 2023

Conversation

MattMcL4475
Copy link
Collaborator

@MattMcL4475 MattMcL4475 commented Apr 19, 2023

Minor improvement to existing test, to guarantee uniqueness of IDs and correct query behavior

@MattMcL4475 MattMcL4475 marked this pull request as draft April 19, 2023 16:24
@MattMcL4475 MattMcL4475 marked this pull request as ready for review April 25, 2023 17:26
@MattMcL4475 MattMcL4475 requested a review from BMurri April 25, 2023 17:26
Console.WriteLine($"Retrieved {runningTasks.Count()} in {sw.Elapsed.TotalSeconds:n1}s");
sw.Restart();
var allOtherTasks = await repository.GetItemsAsync(c => c.State != Models.TesState.RUNNINGEnum);
Console.WriteLine($"Retrieved {allOtherTasks.Count()} in {sw.Elapsed.TotalSeconds:n1}s");
Console.WriteLine($"Total running tasks: {runningTasks.Count()}");
Console.WriteLine($"Total other tasks: {allOtherTasks.Count()}");
var distinctRunningTasksIds = runningTasks.Select(i => i.Id).Distinct().Count();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what I'd recommend is a single line "Assert.AreEqual(itemCount, runningTasks.Concat(allOtherTasks).Select(i => i.Id).Distinct().Count());"

@MattMcL4475 MattMcL4475 merged commit 3a2084e into main Apr 25, 2023
@MattMcL4475 MattMcL4475 deleted the task/UpdateTestToVerifyIdUniqueness branch April 25, 2023 20:44
@ngambani ngambani added this to the 4.3.0 milestone Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants