Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

psp-9530 allow research files to add retired properties. #4534

Merged
merged 3 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion source/backend/api/Services/IPropertyService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public interface IPropertyService

PimsProperty PopulateNewProperty(PimsProperty property, bool isOwned = false, bool isPropertyOfInterest = true);

void UpdateLocation(PimsProperty incomingProperty, ref PimsProperty propertyToUpdate, IEnumerable<UserOverrideCode> overrideCodes);
void UpdateLocation(PimsProperty incomingProperty, ref PimsProperty propertyToUpdate, IEnumerable<UserOverrideCode> overrideCodes, bool allowRetired = false);

T PopulateNewFileProperty<T>(T fileProperty)
where T : IFilePropertyEntity;
Expand Down
8 changes: 4 additions & 4 deletions source/backend/api/Services/PropertyService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
using Microsoft.Extensions.Logging;
using NetTopologySuite.Geometries;
using Pims.Api.Constants;
using Pims.Core.Api.Exceptions;
using Pims.Api.Models.CodeTypes;
using Pims.Api.Models.Concepts.Property;
using Pims.Core.Api.Exceptions;
using Pims.Core.Exceptions;
using Pims.Core.Extensions;
using Pims.Core.Security;
using Pims.Dal.Entities;
using Pims.Dal.Exceptions;
using Pims.Dal.Helpers;
using Pims.Dal.Helpers.Extensions;
using Pims.Dal.Repositories;
using Pims.Core.Security;

namespace Pims.Api.Services
{
Expand Down Expand Up @@ -387,7 +387,7 @@ public PimsProperty PopulateNewProperty(PimsProperty property, bool isOwned = fa
return property;
}

public void UpdateLocation(PimsProperty incomingProperty, ref PimsProperty propertyToUpdate, IEnumerable<UserOverrideCode> overrideCodes)
public void UpdateLocation(PimsProperty incomingProperty, ref PimsProperty propertyToUpdate, IEnumerable<UserOverrideCode> overrideCodes, bool allowRetired = false)
{
if (propertyToUpdate.Location == null || propertyToUpdate.Boundary == null)
{
Expand Down Expand Up @@ -415,7 +415,7 @@ public void UpdateLocation(PimsProperty incomingProperty, ref PimsProperty prope

if (needsUpdate)
{
_propertyRepository.Update(propertyToUpdate, overrideLocation: true);
_propertyRepository.Update(propertyToUpdate, overrideLocation: true, allowRetired: allowRetired);
}
}
else
Expand Down
4 changes: 2 additions & 2 deletions source/backend/api/Services/ResearchFileService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ private void MatchProperties(PimsResearchFile researchFile, IEnumerable<UserOver
{
var foundProperty = _propertyRepository.GetByPid(pid, true);
researchProperty.PropertyId = foundProperty.Internal_Id;
_propertyService.UpdateLocation(researchProperty.Property, ref foundProperty, userOverrideCodes);
_propertyService.UpdateLocation(researchProperty.Property, ref foundProperty, userOverrideCodes, allowRetired: true);
researchProperty.Property = foundProperty;
}
catch (KeyNotFoundException)
Expand All @@ -225,7 +225,7 @@ private void MatchProperties(PimsResearchFile researchFile, IEnumerable<UserOver
{
var foundProperty = _propertyRepository.GetByPin(pin, true);
researchProperty.PropertyId = foundProperty.Internal_Id;
_propertyService.UpdateLocation(researchProperty.Property, ref foundProperty, userOverrideCodes);
_propertyService.UpdateLocation(researchProperty.Property, ref foundProperty, userOverrideCodes, allowRetired: true);
researchProperty.Property = foundProperty;
}
catch (KeyNotFoundException)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public interface IPropertyRepository : IRepository<PimsProperty>

long GetAllAssociationsCountById(long id);

PimsProperty Update(PimsProperty property, bool overrideLocation = false);
PimsProperty Update(PimsProperty property, bool overrideLocation = false, bool allowRetired = false);

PimsProperty UpdatePropertyManagement(PimsProperty property);

Expand Down
4 changes: 2 additions & 2 deletions source/backend/dal/Repositories/PropertyRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ public long GetAllAssociationsCountById(long id)
/// <param name="property">The property to update.</param>
/// <param name="overrideLocation">Whether to update the property spatial location with the incoming value. Defaults to false.</param>
/// <returns>The updated property.</returns>
public PimsProperty Update(PimsProperty property, bool overrideLocation = false)
public PimsProperty Update(PimsProperty property, bool overrideLocation = false, bool allowRetired = false)
{
property.ThrowIfNull(nameof(property));

Expand All @@ -320,7 +320,7 @@ public PimsProperty Update(PimsProperty property, bool overrideLocation = false)
.FirstOrDefault(p => p.PropertyId == propertyId) ?? throw new KeyNotFoundException();

// prevent editing on retired properties
if (existingProperty.IsRetired.HasValue && existingProperty.IsRetired.Value)
if (existingProperty.IsRetired.HasValue && existingProperty.IsRetired.Value && !allowRetired)
{
throw new BusinessRuleViolationException("Retired records are referenced for historical purposes only and cannot be edited or deleted.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1369,7 +1369,7 @@
userRepository.Setup(x => x.GetUserInfoByKeycloakUserId(It.IsAny<Guid>())).Returns(EntityHelper.CreateUser(1, Guid.NewGuid(), "Test", regionCode: 1));

var propertyService = this._helper.GetService<Mock<IPropertyService>>();
propertyService.Setup(x => x.UpdateLocation(It.IsAny<PimsProperty>(), ref It.Ref<PimsProperty>.IsAny, It.IsAny<IEnumerable<UserOverrideCode>>()));
propertyService.Setup(x => x.UpdateLocation(It.IsAny<PimsProperty>(), ref It.Ref<PimsProperty>.IsAny, It.IsAny<IEnumerable<UserOverrideCode>>(), false));

var solver = this._helper.GetService<Mock<IAcquisitionStatusSolver>>();
solver.Setup(x => x.CanEditProperties(It.IsAny<AcquisitionStatusTypes?>())).Returns(true);
Expand All @@ -1380,7 +1380,7 @@
// Assert
filePropertyRepository.Verify(x => x.GetPropertiesByAcquisitionFileId(It.IsAny<long>()), Times.Once);
filePropertyRepository.Verify(x => x.Update(It.IsAny<PimsPropertyAcquisitionFile>()), Times.Once);
propertyService.Verify(x => x.UpdateLocation(It.IsAny<PimsProperty>(), ref It.Ref<PimsProperty>.IsAny, It.IsAny<IEnumerable<UserOverrideCode>>()), Times.Once);
propertyService.Verify(x => x.UpdateLocation(It.IsAny<PimsProperty>(), ref It.Ref<PimsProperty>.IsAny, It.IsAny<IEnumerable<UserOverrideCode>>(), false), Times.Once);
propertyService.Verify(x => x.UpdateFilePropertyLocation<PimsPropertyAcquisitionFile>(It.IsAny<PimsPropertyAcquisitionFile>(), It.IsAny<PimsPropertyAcquisitionFile>()), Times.Once);
}

Expand Down Expand Up @@ -1412,7 +1412,7 @@
userRepository.Setup(x => x.GetUserInfoByKeycloakUserId(It.IsAny<Guid>())).Returns(EntityHelper.CreateUser(1, Guid.NewGuid(), "Test", regionCode: 1));

var propertyService = this._helper.GetService<Mock<IPropertyService>>();
propertyService.Setup(x => x.UpdateLocation(It.IsAny<PimsProperty>(), ref It.Ref<PimsProperty>.IsAny, It.IsAny<IEnumerable<UserOverrideCode>>()));

Check failure on line 1415 in source/backend/tests/unit/api/Services/AcquisitionFileServiceTest.cs

View workflow job for this annotation

GitHub Actions / build-backend (./source/backend/api, Pims.sln)

An expression tree may not contain a call or invocation that uses optional arguments

Check failure on line 1415 in source/backend/tests/unit/api/Services/AcquisitionFileServiceTest.cs

View workflow job for this annotation

GitHub Actions / build-backend (./source/backend/api, Pims.sln)

An expression tree may not contain a call or invocation that uses optional arguments

var solver = this._helper.GetService<Mock<IAcquisitionStatusSolver>>();
solver.Setup(x => x.CanEditProperties(It.IsAny<AcquisitionStatusTypes?>())).Returns(true);
Expand Down Expand Up @@ -1888,7 +1888,7 @@
userRepository.Setup(x => x.GetUserInfoByKeycloakUserId(It.IsAny<Guid>())).Returns(EntityHelper.CreateUser(1, Guid.NewGuid(), "Test", regionCode: 1));

var propertyService = this._helper.GetService<Mock<IPropertyService>>();
propertyService.Setup(x => x.UpdateLocation(It.IsAny<PimsProperty>(), ref It.Ref<PimsProperty>.IsAny, It.IsAny<IEnumerable<UserOverrideCode>>()));
propertyService.Setup(x => x.UpdateLocation(It.IsAny<PimsProperty>(), ref It.Ref<PimsProperty>.IsAny, It.IsAny<IEnumerable<UserOverrideCode>>(), false));

var solver = this._helper.GetService<Mock<IAcquisitionStatusSolver>>();
solver.Setup(x => x.CanEditProperties(It.IsAny<AcquisitionStatusTypes?>())).Returns(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -988,7 +988,7 @@
userRepository.Setup(x => x.GetUserInfoByKeycloakUserId(It.IsAny<Guid>())).Returns(EntityHelper.CreateUser(1, Guid.NewGuid(), "Test", regionCode: 1));

var propertyService = this._helper.GetService<Mock<IPropertyService>>();
propertyService.Setup(x => x.UpdateLocation(It.IsAny<PimsProperty>(), ref It.Ref<PimsProperty>.IsAny, It.IsAny<IEnumerable<UserOverrideCode>>()));
propertyService.Setup(x => x.UpdateLocation(It.IsAny<PimsProperty>(), ref It.Ref<PimsProperty>.IsAny, It.IsAny<IEnumerable<UserOverrideCode>>(), false));
propertyService.Setup(x => x.UpdateFilePropertyLocation<PimsDispositionFileProperty>(It.IsAny<PimsDispositionFileProperty>(), It.IsAny<PimsDispositionFileProperty>()));

// Act
Expand All @@ -997,7 +997,7 @@
// Assert
filePropertyRepository.Verify(x => x.GetPropertiesByDispositionFileId(It.IsAny<long>()), Times.Once);
filePropertyRepository.Verify(x => x.Update(It.IsAny<PimsDispositionFileProperty>()), Times.Once);
propertyService.Verify(x => x.UpdateLocation(It.IsAny<PimsProperty>(), ref It.Ref<PimsProperty>.IsAny, It.IsAny<IEnumerable<UserOverrideCode>>()), Times.Once);
propertyService.Verify(x => x.UpdateLocation(It.IsAny<PimsProperty>(), ref It.Ref<PimsProperty>.IsAny, It.IsAny<IEnumerable<UserOverrideCode>>(), false), Times.Once);
propertyService.Verify(x => x.UpdateFilePropertyLocation<PimsDispositionFileProperty>(It.IsAny<PimsDispositionFileProperty>(), It.IsAny<PimsDispositionFileProperty>()), Times.Once);
}

Expand Down Expand Up @@ -1029,7 +1029,7 @@
userRepository.Setup(x => x.GetUserInfoByKeycloakUserId(It.IsAny<Guid>())).Returns(EntityHelper.CreateUser(1, Guid.NewGuid(), "Test", regionCode: 1));

var propertyService = this._helper.GetService<Mock<IPropertyService>>();
propertyService.Setup(x => x.UpdateLocation(It.IsAny<PimsProperty>(), ref It.Ref<PimsProperty>.IsAny, It.IsAny<IEnumerable<UserOverrideCode>>()));

Check failure on line 1032 in source/backend/tests/unit/api/Services/DispositionFileServiceTest.cs

View workflow job for this annotation

GitHub Actions / build-backend (./source/backend/api, Pims.sln)

An expression tree may not contain a call or invocation that uses optional arguments

Check failure on line 1032 in source/backend/tests/unit/api/Services/DispositionFileServiceTest.cs

View workflow job for this annotation

GitHub Actions / build-backend (./source/backend/api, Pims.sln)

An expression tree may not contain a call or invocation that uses optional arguments
propertyService.Setup(x => x.UpdateFilePropertyLocation<PimsDispositionFileProperty>(It.IsAny<PimsDispositionFileProperty>(), It.IsAny<PimsDispositionFileProperty>()));

// Act
Expand Down
8 changes: 4 additions & 4 deletions source/backend/tests/unit/api/Services/LeaseServiceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -510,14 +510,14 @@
userRepository.Setup(x => x.GetByKeycloakUserId(It.IsAny<Guid>())).Returns(EntityHelper.CreateUser("Test"));

var propertyService = this._helper.GetService<Mock<IPropertyService>>();
propertyService.Setup(x => x.UpdateLocation(It.IsAny<PimsProperty>(), ref It.Ref<PimsProperty>.IsAny, It.IsAny<IEnumerable<UserOverrideCode>>()));
propertyService.Setup(x => x.UpdateLocation(It.IsAny<PimsProperty>(), ref It.Ref<PimsProperty>.IsAny, It.IsAny<IEnumerable<UserOverrideCode>>(), false));

// Act
var updatedLease = service.Update(lease, new List<UserOverrideCode>() { UserOverrideCode.AddLocationToProperty });

// Assert
leaseRepository.Verify(x => x.Update(lease, false), Times.Once);
propertyService.Verify(x => x.UpdateLocation(It.IsAny<PimsProperty>(), ref It.Ref<PimsProperty>.IsAny, It.IsAny<IEnumerable<UserOverrideCode>>()), Times.Once);
propertyService.Verify(x => x.UpdateLocation(It.IsAny<PimsProperty>(), ref It.Ref<PimsProperty>.IsAny, It.IsAny<IEnumerable<UserOverrideCode>>(), false), Times.Once);
}

[Fact]
Expand Down Expand Up @@ -674,14 +674,14 @@
userRepository.Setup(x => x.GetByKeycloakUserId(It.IsAny<Guid>())).Returns(EntityHelper.CreateUser("Test"));

var propertyService = this._helper.GetService<Mock<IPropertyService>>();
propertyService.Setup(x => x.UpdateLocation(It.IsAny<PimsProperty>(), ref It.Ref<PimsProperty>.IsAny, It.IsAny<IEnumerable<UserOverrideCode>>()));
propertyService.Setup(x => x.UpdateLocation(It.IsAny<PimsProperty>(), ref It.Ref<PimsProperty>.IsAny, It.IsAny<IEnumerable<UserOverrideCode>>(), false));

// Act
var updatedLease = service.Update(lease, new List<UserOverrideCode>() { UserOverrideCode.AddLocationToProperty });

// Assert
leaseRepository.Verify(x => x.Update(lease, false), Times.Once);
propertyService.Verify(x => x.UpdateLocation(It.IsAny<PimsProperty>(), ref It.Ref<PimsProperty>.IsAny, It.IsAny<IEnumerable<UserOverrideCode>>()), Times.Once);
propertyService.Verify(x => x.UpdateLocation(It.IsAny<PimsProperty>(), ref It.Ref<PimsProperty>.IsAny, It.IsAny<IEnumerable<UserOverrideCode>>(), false), Times.Once);
}

[Fact]
Expand Down Expand Up @@ -711,7 +711,7 @@
userRepository.Setup(x => x.GetByKeycloakUserId(It.IsAny<Guid>())).Returns(EntityHelper.CreateUser("Test"));

var propertyService = this._helper.GetService<Mock<IPropertyService>>();
propertyService.Setup(x => x.UpdateLocation(It.IsAny<PimsProperty>(), ref It.Ref<PimsProperty>.IsAny, It.IsAny<IEnumerable<UserOverrideCode>>()));

Check failure on line 714 in source/backend/tests/unit/api/Services/LeaseServiceTest.cs

View workflow job for this annotation

GitHub Actions / build-backend (./source/backend/api, Pims.sln)

An expression tree may not contain a call or invocation that uses optional arguments

Check failure on line 714 in source/backend/tests/unit/api/Services/LeaseServiceTest.cs

View workflow job for this annotation

GitHub Actions / build-backend (./source/backend/api, Pims.sln)

An expression tree may not contain a call or invocation that uses optional arguments

// Act
var updatedLease = service.Update(lease, new List<UserOverrideCode>() { UserOverrideCode.AddLocationToProperty });
Expand Down
24 changes: 12 additions & 12 deletions source/backend/tests/unit/api/Services/PropertyServiceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public void Update_Property_No_Reprojection_Success()

var service = this.CreatePropertyServiceWithPermissions(Permissions.PropertyView, Permissions.PropertyEdit);
var repository = this._helper.GetService<Mock<IPropertyRepository>>();
repository.Setup(x => x.Update(It.IsAny<PimsProperty>(), It.IsAny<bool>())).Returns(property);
repository.Setup(x => x.Update(It.IsAny<PimsProperty>(), It.IsAny<bool>(), false)).Returns(property);
repository.Setup(x => x.GetById(It.IsAny<long>())).Returns(property);
var coordinateService = this._helper.GetService<Mock<ICoordinateTransformService>>();
coordinateService.Setup(x => x.TransformCoordinates(It.IsAny<int>(), It.IsAny<int>(), It.IsAny<Coordinate>()));
Expand All @@ -133,7 +133,7 @@ public void Update_Property_No_Reprojection_Success()
var updatedProperty = service.Update(newValues);

// Assert
repository.Verify(x => x.Update(It.IsAny<PimsProperty>(), It.IsAny<bool>()), Times.Once);
repository.Verify(x => x.Update(It.IsAny<PimsProperty>(), It.IsAny<bool>(), false), Times.Once);
coordinateService.Verify(x => x.TransformCoordinates(It.IsAny<int>(), It.IsAny<int>(), It.IsAny<Coordinate>()));
}

Expand All @@ -145,7 +145,7 @@ public void Update_Property_With_Reprojection_Success()

var service = this.CreatePropertyServiceWithPermissions(Permissions.PropertyView, Permissions.PropertyEdit);
var repository = this._helper.GetService<Mock<IPropertyRepository>>();
repository.Setup(x => x.Update(It.IsAny<PimsProperty>(), It.IsAny<bool>())).Returns(property);
repository.Setup(x => x.Update(It.IsAny<PimsProperty>(), It.IsAny<bool>(), false)).Returns(property);
repository.Setup(x => x.GetById(It.IsAny<long>())).Returns(property);

var projected = new Coordinate(14000, 9200);
Expand All @@ -162,7 +162,7 @@ public void Update_Property_With_Reprojection_Success()

// Assert
coordinateService.Verify(x => x.TransformCoordinates(It.IsAny<int>(), It.IsAny<int>(), It.IsAny<Coordinate>()));
repository.Verify(x => x.Update(It.Is<PimsProperty>(p => p.Location.Coordinate.Equals(projected)), It.IsAny<bool>()), Times.Once);
repository.Verify(x => x.Update(It.Is<PimsProperty>(p => p.Location.Coordinate.Equals(projected)), It.IsAny<bool>(), false), Times.Once);
}

[Fact]
Expand All @@ -175,7 +175,7 @@ public void Update_Property_KeyNotFound()
var property = EntityHelper.CreateProperty(1);

var repository = this._helper.GetService<Mock<IPropertyRepository>>();
repository.Setup(x => x.Update(property, It.IsAny<bool>())).Throws<KeyNotFoundException>();
repository.Setup(x => x.Update(property, It.IsAny<bool>(), false)).Throws<KeyNotFoundException>();
repository.Setup(x => x.GetById(It.IsAny<long>())).Throws<KeyNotFoundException>();

// Assert
Expand All @@ -193,7 +193,7 @@ public void Update_Property_NoPermission()

// Assert
Assert.Throws<NotAuthorizedException>(() => service.Update(property));
repository.Verify(x => x.Update(It.IsAny<PimsProperty>(), It.IsAny<bool>()), Times.Never);
repository.Verify(x => x.Update(It.IsAny<PimsProperty>(), It.IsAny<bool>(), false), Times.Never);
}

#endregion
Expand All @@ -208,7 +208,7 @@ public void UpdateLocation_Requires_UserOverride()

var service = this.CreatePropertyServiceWithPermissions(Permissions.PropertyView, Permissions.PropertyEdit);
var repository = this._helper.GetService<Mock<IPropertyRepository>>();
repository.Setup(x => x.Update(It.IsAny<PimsProperty>(), It.IsAny<bool>())).Returns(property);
repository.Setup(x => x.Update(It.IsAny<PimsProperty>(), It.IsAny<bool>(), false)).Returns(property);

var coordinateService = this._helper.GetService<Mock<ICoordinateTransformService>>();
coordinateService.Setup(x => x.TransformCoordinates(It.IsAny<int>(), It.IsAny<int>(), It.IsAny<Coordinate>())).Returns(new Coordinate(14000, 9200));
Expand All @@ -225,7 +225,7 @@ public void UpdateLocation_Requires_UserOverride()
ex.Which.UserOverride.Should().Be(UserOverrideCode.AddLocationToProperty);

coordinateService.Verify(x => x.TransformCoordinates(It.IsAny<int>(), It.IsAny<int>(), It.IsAny<Coordinate>()), Times.Never);
repository.Verify(x => x.Update(It.IsAny<PimsProperty>(), It.IsAny<bool>()), Times.Never);
repository.Verify(x => x.Update(It.IsAny<PimsProperty>(), It.IsAny<bool>(), false), Times.Never);
}

[Fact]
Expand All @@ -237,7 +237,7 @@ public void UpdateLocation_Success()

var service = this.CreatePropertyServiceWithPermissions(Permissions.PropertyView, Permissions.PropertyEdit);
var repository = this._helper.GetService<Mock<IPropertyRepository>>();
repository.Setup(x => x.Update(It.IsAny<PimsProperty>(), It.IsAny<bool>())).Returns(property);
repository.Setup(x => x.Update(It.IsAny<PimsProperty>(), It.IsAny<bool>(), false)).Returns(property);

var coordinateService = this._helper.GetService<Mock<ICoordinateTransformService>>();
coordinateService.Setup(x => x.TransformCoordinates(It.IsAny<int>(), It.IsAny<int>(), It.IsAny<Coordinate>()))
Expand All @@ -252,7 +252,7 @@ public void UpdateLocation_Success()

// Assert
coordinateService.Verify(x => x.TransformCoordinates(It.IsAny<int>(), It.IsAny<int>(), It.IsAny<Coordinate>()), Times.Once);
repository.Verify(x => x.Update(It.Is<PimsProperty>(p => p.Location.Coordinate.Equals(new Coordinate(14000, 9200))), It.IsAny<bool>()), Times.Once);
repository.Verify(x => x.Update(It.Is<PimsProperty>(p => p.Location.Coordinate.Equals(new Coordinate(14000, 9200))), It.IsAny<bool>(), false), Times.Once);
}

[Fact]
Expand All @@ -265,7 +265,7 @@ public void UpdateLocation_Boundary_Success()

var service = this.CreatePropertyServiceWithPermissions(Permissions.PropertyView, Permissions.PropertyEdit);
var repository = this._helper.GetService<Mock<IPropertyRepository>>();
repository.Setup(x => x.Update(It.IsAny<PimsProperty>(), It.IsAny<bool>())).Returns(property);
repository.Setup(x => x.Update(It.IsAny<PimsProperty>(), It.IsAny<bool>(), false)).Returns(property);

var coordinateService = this._helper.GetService<Mock<ICoordinateTransformService>>();
coordinateService.Setup(x => x.TransformCoordinates(It.IsAny<int>(), It.IsAny<int>(), It.IsAny<Coordinate>()))
Expand All @@ -291,7 +291,7 @@ public void UpdateLocation_Boundary_Success()
// Assert
coordinateService.Verify(x => x.TransformCoordinates(It.IsAny<int>(), It.IsAny<int>(), It.IsAny<Coordinate>()), Times.Once);
coordinateService.Verify(x => x.TransformGeometry(It.IsAny<int>(), It.IsAny<int>(), It.IsAny<Geometry>()), Times.Once);
repository.Verify(x => x.Update(property, true), Times.Once);
repository.Verify(x => x.Update(property, true, false), Times.Once);
property.Location.Coordinate.Should().Be(new Coordinate(14000, 9200));
property.Boundary.Should().BeOfType<Polygon>();
var updatedBoundary = property.Boundary as Polygon;
Expand Down
Loading
Loading