You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

RandomTests.cs 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using System.Linq;
  2. using Luticate2.Auth.DataAccess;
  3. using Luticate2.Auth.DataAccess.Models;
  4. using Microsoft.EntityFrameworkCore;
  5. using Xunit;
  6. namespace Luticate2.Auth.Tests
  7. {
  8. public class RandomTests
  9. {
  10. [Fact]
  11. public void Test1()
  12. {
  13. var dbContext = new luticate2Context();
  14. var items = dbContext.LuGroups.Where(groups => groups.LuGroupsObjects.Any(x => x.Priority == 0));
  15. var list = items.ToList();
  16. Assert.NotNull(list);
  17. Assert.Equal(1, list.Count);
  18. }
  19. [Fact]
  20. public void Test2()
  21. {
  22. var dbContext = new luticate2Context();
  23. var items = dbContext.LuGroups.OrderBy(x => x.Id).Where(groups => groups.LuGroupsObjects.Any(x => x.Priority == 0));
  24. var list = items.ToList();
  25. Assert.NotNull(list);
  26. Assert.Equal(1, list.Count);
  27. }
  28. [Fact]
  29. public void Test3()
  30. {
  31. var dbContext = new luticate2Context();
  32. var items = dbContext.LuGroups.OrderBy(x => x.Id);
  33. var list = items.ToList();
  34. Assert.NotNull(list);
  35. Assert.Equal(2, list.Count);
  36. }
  37. }
  38. }