public void InterfaceCoolWorks() { SpeedBoat speedboat = new SpeedBoat(); bool output = speedboat.IHasBow(); Assert.True(output); }
// [Fact] public void InterfaceBowMethodFunctions() { SpeedBoat speedboat = new SpeedBoat(); string output = speedboat.HasFlag(); Assert.Equal("True", output); }
public void BoatSpeedTest() { SpeedBoat bSpeed = new SpeedBoat(1, "gas", 30, true); double expected = bSpeed.BoatSpeed(bSpeed.AverageSpeedInKnots, 25); //double actual = bSpeed.BoatSpeed(bSpeed.AverageSpeedInKnots, 45); Assert.IsTrue(expected < .25); }
static void Main(string[] args) { Console.WriteLine("Hello World!"); var amphibiousVehicle = new AmphibiousVehicle(new Manufacturer() { Name = "DontKnow" }); amphibiousVehicle.Drive(); amphibiousVehicle.Swim(); ISwimable swimable = new AmphibiousVehicle(new Manufacturer() { Name = "DontKnowAlso" }); swimable.Swim(); IDriveable driveable = new AmphibiousVehicle(new Manufacturer() { Name = "DontKnowAlsoToo" }); driveable.Drive(); SpeedBoat speedBoat = new SpeedBoat(); speedBoat.Swim(); IList <ISwimable> swimables = new List <ISwimable>(); swimables.Add(amphibiousVehicle); swimables.Add(swimable); swimables.Add(speedBoat); SwimAll(swimables); #region zu //Manufacturer bmw = new Manufacturer(); //bmw.Name = "BMW"; //Car car = new Car(bmw); //Console.WriteLine(car.ToString()); //car.Drive(); //Manufacturer ford = new Manufacturer() { Name = "Ford" }; //Truck truck = new Truck(ford); //Console.WriteLine(truck.ToString()); //truck.Drive(); #endregion Console.ReadLine(); //Car car = new Car(new Manufacturer() { Name = "BMW" }); }
public void SpeedBoatCanTurnOn() { //arrange SpeedBoat speedboat = new SpeedBoat(); //act string var = speedboat.TurnOn(); //assert Assert.Equal("The boat has turned on.", var); }
public void SpeedBoatMakesNoise() { //arrange SpeedBoat speedboat = new SpeedBoat(); //act bool output1 = speedboat.MakesNoise; //assert Assert.True(output1); }
public void SpeedBoatCanDrive() { //arrange SpeedBoat speedboat = new SpeedBoat(); //act string output = speedboat.Drives(); //assert Assert.Equal("The Boat is Driving!", output); }
public void SpeedBoatPrice() { //arrange SpeedBoat speedboat = new SpeedBoat(); //act int output1 = speedboat.Price; //assert Assert.Equal(32000, output1); }
public void SpeedBoatIsReaL() { //arrange SpeedBoat speedboat = new SpeedBoat(); //act bool output = speedboat.IsReal; //assert Assert.True(output); }
public void SpeedBoatCanreverse() { //arrange SpeedBoat speedboat = new SpeedBoat(); //act string output = speedboat.CanReverse(); //assert Assert.Equal("the boat is going in reverse", output); }
public static void Main() { // Build a collection of all vehicles that fly List <IAirVehicle> thingsThatFly = new List <IAirVehicle>(); Cessna plane = new Cessna(); Propplane pesticide = new Propplane(); thingsThatFly.Add(plane); thingsThatFly.Add(pesticide); // With a single `foreach`, have each vehicle Fly() foreach (IAirVehicle flys in thingsThatFly) { flys.Fly(); } // Build a collection of all vehicles that operate on roads List <ILandVehicle> thingsThatDrive = new List <ILandVehicle>(); Motorcycle bike = new Motorcycle(); Ferrari coolCar = new Ferrari(); thingsThatDrive.Add(bike); thingsThatDrive.Add(coolCar); // With a single `foreach`, have each road vehicle Drive() foreach (ILandVehicle ride in thingsThatDrive) { ride.Drive(); } // Build a collection of all vehicles that operate on water List <IWaterVehicle> thingsThatSwim = new List <IWaterVehicle>(); JetSki ski = new JetSki(); SpeedBoat midlifeCrisis = new SpeedBoat(); thingsThatSwim.Add(ski); thingsThatSwim.Add(midlifeCrisis); // With a single `foreach`, have each water vehicle Drive() foreach (IWaterVehicle swim in thingsThatSwim) { swim.Drive(); } }
static void ThingsSpeedBoatCanDo() { SpeedBoat speedboat = new SpeedBoat(); Console.WriteLine("Hello World!"); Console.WriteLine("-----Does a speedBoat have a Bow?-----"); bool output1 = speedboat.HasBow; Console.WriteLine(output1); Console.WriteLine("-----is a speedBoat Real?-----"); bool output2 = speedboat.IsReal; Console.WriteLine(output2); Console.WriteLine("-----can a speedBoat drive?-----"); Console.WriteLine(speedboat.Drives()); Console.WriteLine("-----Can the speedBoat turn on?-----"); Console.WriteLine(speedboat.TurnOn()); Console.WriteLine("-----Can the speedBoat turn off?-----"); Console.WriteLine(speedboat.TurnOff()); Console.WriteLine("price:"); Console.WriteLine(speedboat.Price); Console.ReadLine(); Console.WriteLine(speedboat.RaiseFlag()); }