TrajectoryVisualizationServiceTest. Update test

This commit is contained in:
ngfrolov 2023-02-15 13:46:17 +05:00
parent 2e59d97dcd
commit 5070863ed4
Signed by: ng.frolov
GPG Key ID: E99907A0357B29A7

View File

@ -66,7 +66,6 @@ namespace AsbCloudWebApi.Tests.ServicesTests
Assert.Equal(50d, lastPoint.Z, 0.1d);
}
[Fact]
public async Task GetTrajectoryAsync_Match()
{
@ -81,24 +80,11 @@ namespace AsbCloudWebApi.Tests.ServicesTests
var service = new TrajectoryVisualizationService(mock.Object);
var result = await service.GetTrajectoryAsync(1, CancellationToken.None);
var lastPoint = result.Last();
var tolerance = 0.001d;
var deltaLength = plannedTrajectory[2].WellboreDepth - plannedTrajectory[1].WellboreDepth;
var zenith = plannedTrajectory[1].ZenithAngle * Math.PI / 1800;
var azimuth = plannedTrajectory[1].AzimuthGeo * Math.PI / 1800;
var dz = deltaLength * Math.Cos(zenith);
var xySurfaceSegmentProjectionLength = deltaLength * Math.Sin(zenith);
var dx = xySurfaceSegmentProjectionLength * Math.Cos(azimuth);
var dy = xySurfaceSegmentProjectionLength * Math.Sin(azimuth);
var Z = plannedTrajectory[1].WellboreDepth + dz;
var X = dx;
var Y = dy;
Assert.Equal(0d, lastPoint.X, 1d);
Assert.Equal(0d, lastPoint.Y, 1d);
Assert.Equal(50d, lastPoint.Z, 1d);
Assert.InRange(lastPoint.Z, 10 + tolerance, 20 - tolerance);
Assert.InRange(lastPoint.Y, 0 + tolerance, 10 - tolerance);
Assert.InRange(lastPoint.X, 0 + tolerance, 10 - tolerance);
}
}
}