public async void ShouldAddComplaint() { //Given var now = DateTime.Now; var calendar = await CalendarRepository.Add(Calendars[0].Date); await CompanyRepository.Add(Companies[0], true); await TripRepository.Add(Trips[0]); await VehicleRepository.Add(Vehicles[0], true); var status = await StatusRepository.Add(new Status { Name = "Open" }, true); var location = new Point(new Coordinate(-122.3456, 45.67890)); var complaintDTO = new ComplaintDTO { SubmittedDate = Calendars[0].Date + now.TimeOfDay, Location = location.ToGeoJson <GeoJSON.Net.Geometry.Point>(), CompanyName = Companies[0].Name, VehicleName = Vehicles[0].Name, VehicleTypeKey = 1, ComplaintTypeKey = 8, ComplaintDetails = "Vehicle component issue", Complaints = new string[] { } }; //When var result = await Controller.PostAsync(complaintDTO); var dbCollision = await ComplaintRepository.Find(1); //Then var viewResult = Assert.IsType <OkObjectResult>(result); var model = Assert.IsType <ComplaintDTO>(viewResult.Value); Assert.NotNull(model); Assert.Equal(complaintDTO.SubmittedDate, model.SubmittedDate); Assert.True(dbCollision.FirstSeen == dbCollision.LastSeen); }