public void Should_add_location_header_to_the_message_when_response_contains_a_api_resource() { var apiResource = new TestResource(); var response = new ConflictResponse(apiResource); AssertExpectedStatus(response); response.Headers.Location.ShouldEqual(apiResource.Location); }
private void ImportWaypoints(Map newMap) { bool Continue = false; ConflictResponse response = ConflictResponse.Merged; foreach (Waypoint wp in newMap.GetWaypoints()) { if (map.HasWaypoint(wp.Location)) { // There is a conflict in waypoints if (Continue && response == ConflictResponse.Original) { // User has chosen to use the original waypoint, don't change anything break; } Waypoint oldWp = map.GetWaypoint(wp.Location); if (wp.IsExactMatch(oldWp)) { // The original waypoint is an exact match, no need to change break; } // Resolve the conflict WaypointConflict conflict = new WaypointConflict(oldWp, wp); conflict.Text = "Waypoint Conflict - " + wp.Location.ToString(); if (!Continue) { // User has not opted to bypass resolution screen conflict.ShowDialog(this); response = conflict.Response; Continue = conflict.ContinueWithRemaining; } // Correct the resolved conflict if (response == ConflictResponse.New) { oldWp.Copy(wp); } else if (response == ConflictResponse.Merged) { oldWp.Copy(conflict.Merged); } } else { // There was no conflict map.AddWaypoint(wp); } } }
private void btnUseNew_Click(object sender, EventArgs e) { this.Response = ConflictResponse.New; this.Close(); }
private void btnUseOriginal_Click(object sender, EventArgs e) { this.Response = ConflictResponse.Original; this.Close(); }
private void btnOK_Click(object sender, EventArgs e) { this.Response = ConflictResponse.Merged; this.ContinueWithRemaining = chkContinue.Checked; this.Close(); }
public void Should_return_an_http_response_message_with_expected_status() { var response = new ConflictResponse(); AssertExpectedStatus(response); }