示例#1
0
 public CarService(string name, ConsumptionAtSpeed lowSpeedConsumption, ConsumptionAtSpeed highSpeedConsumption, double maxSpeed)
 {
     Name = name;
     LowSpeedConsumption = lowSpeedConsumption;
     HighSpeedConsumption = highSpeedConsumption;
     MaxSpeed = maxSpeed;
 }
示例#2
0
 public ICar Create(string name, ConsumptionAtSpeed lowSpeedConsumption, ConsumptionAtSpeed highSpeedConsumption, double maxSpeed)
 {
     lowSpeedConsumption.AssertNotNull();
     highSpeedConsumption.AssertNotNull();
     maxSpeed.AssertPositive();
     maxSpeed.AssertLargerThan(0);
     
     var Car = new CarService(name, lowSpeedConsumption, highSpeedConsumption, maxSpeed);
     return Car;
 }