public void Should_convert_vehicle_plot_to_dto(int vehicleId, double latitude, double longitude, EventCode eventCode)
        {
            //Arrange
            var vehiclePlot        = new VehiclePlot(vehicleId, latitude, longitude, DateTime.UtcNow, eventCode);
            var expectedDefinition = JsonConvert.SerializeObject(vehiclePlot, _jsonSerializerSettings);

            //Act
            var vehiclePlotDto = Sut.ToDto(vehiclePlot);

            //Assert
            vehiclePlotDto.Id.Should().Be(vehiclePlot.VehicleId);
            vehiclePlotDto.Score.Should().Be(vehiclePlot.Timestamp.ToOADate());
            vehiclePlotDto.Definition.Should().Be(expectedDefinition);
        }
Пример #2
0
 public async Task InsertAsync(VehiclePlot vehiclePlot)
 {
     var vehiclePlotDto = _vehiclePlotFactory.ToDto(vehiclePlot);
     await _vehiclePlotDao.InsertAsync(vehiclePlotDto);
 }