public void PropertiesRequiredValid() { var vehicle = EntitiesFactory.GetNewVehicle(); bool result = vehicle.ValidatePropertiesRequired(); result.Should().BeTrue(); }
public async void RemoveValid() { var vehicle = EntitiesFactory.GetNewVehicle(); _vehicleRepository.Save(vehicle).Returns(true); bool result = await _vehicleService.Remove(vehicle); result.Should().BeTrue(); }
public async void GetByIdValid() { var vehicle = EntitiesFactory.GetNewVehicle(); _vehicleRepository.GetById(vehicle.Id).Returns(vehicle); var result = await _vehicleService.GetById(vehicle.Id); result.Should().NotBeNull(); }
public async void GetByIdInvalid(string id) { var vehicle = EntitiesFactory.GetNewVehicle(); _vehicleRepository.GetById(id).Returns(vehicle); var result = await _vehicleService.GetById(id); result.Should().BeNull(); }
public async void RemoveInvalid(string id) { var vehicle = EntitiesFactory.GetNewVehicle(); vehicle.Id = id; _vehicleRepository.Save(vehicle).Returns(true); bool result = await _vehicleService.Remove(vehicle); result.Should().BeFalse(); }
public async void GetByVehicleClassValid() { var vehicle = EntitiesFactory.GetNewVehicle(); List <Vehicle> listReturn = EntitiesFactory.GetVehicleList(); _vehicleRepository.GetByVehicleClass(vehicle.VehicleClass).Returns(listReturn); IEnumerable <Vehicle> result = await _vehicleService.GetByVehicleClass(vehicle.VehicleClass); result.Should().NotBeNull(); }
public async void GetByCompanyIdValid() { List <Vehicle> listReturn = EntitiesFactory.GetVehicleList(); var vehicle = EntitiesFactory.GetNewVehicle(); listReturn.Add(vehicle); _vehicleRepository.GetByCompanyId(vehicle.CompanyId).Returns(listReturn); IEnumerable <Vehicle> result = await _vehicleService.GetByCompanyId(vehicle.CompanyId); result.Should().NotBeNull(); }