public async void ShouldAddCollision() { //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 collisionDTO = new CollisionDTO { Date = Calendars[0].Date + now.TimeOfDay, Location = location.ToGeoJson <GeoJSON.Net.Geometry.Point>(), CompanyName = Companies[0].Name, VehicleName = Vehicles[0].Name, TripAlternateKey = Trips[0].AlternateKey, VehicleTypeKey = 4, OtherVehicleTypeKey = 1, ClaimStatusKey = Convert.ToByte(status.Key) }; //When var result = await Controller.PostAsync(collisionDTO); var dbCollision = await CollisionRepository.Find(1); //Then var viewResult = Assert.IsType <OkObjectResult>(result); var model = Assert.IsType <CollisionDTO>(viewResult.Value); Assert.NotNull(model); Assert.Equal(collisionDTO.Date, model.Date); Assert.True(dbCollision.FirstSeen == dbCollision.LastSeen); }