public async Task ShouldCreateVenue() { string venueName3 = "Venue name 3"; string venueAddress3 = "Testing gate 215"; VenueService venueService = new VenueService(_dbContext, _mainEventProvider); SecurityService securityService = new SecurityService(_dbContext, _userManager, _roleManager); VenueController venueController = new VenueController(venueService, securityService); CreateUser(); CreateVenues(); SetUser(venueController, _createdUser2.Entity.Id); VenueVm venueVm = new VenueVm { Name = venueName3, Address = venueAddress3, PostalCode = "0258", ContactEMail = "*****@*****.**", ContactPhone = "1234578", OrganizerId = 2 }; await venueController.CreateVenueAsync(venueVm); ActionResult <List <VenueListVm> > result = await venueController.GetVenuesAsync(); List <VenueListVm> venues = (List <VenueListVm>)((OkObjectResult)result.Result).Value; Venue createdVenue = _dbContext.Venues.Find(3); Assert.AreEqual(3, venues.Count); Assert.That(venues, Has.Exactly(1).Matches <VenueListVm>(venue => venue.Id == createdVenue.Id && venue.Name == createdVenue.Name && venue.Address == createdVenue.Address )); }