示例#1
0
        public void HandleNextVehicle_ReturnsVehicleModelState()
        {
            // Arrange
            var mapper           = Arrange.GetMapper();
            var driverRepository = Arrange.GetGenericRepository <Driver>();
            var sut              = new ReceiverLogic(mapper, driverRepository);
            var vehicleState     = Arrange.GetDrivingVehicleInSector3();
            var nextVehicleState = Arrange.GetJsonTrackState().vehicles[0];

            // Act
            //sut.HandleNextVehicleState(vehicleState, nextVehicleState);

            // Assert
            //Assert.NotNull(vehicleState);
            //Assert.Equal(vehicleState.DriverName, nextVehicleState.driverName);
        }
示例#2
0
        public void HandleNext_SavesInitialTrackState()
        {
            // Arrange
            var mapper           = Arrange.GetMapper();
            var driverRepository = Arrange.GetGenericRepository <Driver>();
            var sut       = new ReceiverLogic(mapper, driverRepository);
            var jsonTrack = Arrange.GetJsonTrackState();

            // Act
            //sut.HandleNext(jsonTrack);
            //var vehicle = driverRepository.GetAll().FirstOrDefault();

            // Assert
            //Assert.NotNull(vehicle);
            //Assert.Equal(1, driverRepository.GetAll().Count());
            //Assert.Equal(jsonTrack.vehicles[0].driverName, vehicle.Name);
        }
示例#3
0
        public void MapTrack_ReturnsFullyMappedTrackModel()
        {
            // Arrange
            var sut       = Arrange.GetMapper();
            var jsonTrack = Arrange.GetJsonTrackState();

            // Act
            var track = sut.MapTrack(jsonTrack);

            // Assert
            Assert.NotNull(track);
            Assert.NotNull(track.Vehicles);
            Assert.NotEmpty(track.Vehicles);
            Assert.Equal(2, track.Vehicles.Count);
            Assert.Equal(jsonTrack.trackName, track.Name);
            Assert.Equal(jsonTrack.lapDist, track.Distance);
        }