Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2019
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. [Fact]
  2. public async void GetProjectType_ReturnsNotFound_WhenIdIsOutOfRange()
  3. {
  4. var options = new DbContextOptionsBuilder<BlueInkDbContext>()
  5. .UseInMemoryDatabase("GetProjectType_ReturnsNotFound_WhenIdIsInvalid").Options;
  6.  
  7. using var context = new BlueInkDbContext(options);
  8. context.ProjectTypes.Add(new ProjectType { Id = 1, Name = "Software" });
  9. context.SaveChanges();
  10.  
  11. var controller = new ProjectTypesController(context);
  12.  
  13. var result = (await controller.GetProjectType(2)) as NotFoundResult;
  14. Assert.NotNull(result);
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement