public void GrizzlyBearCanInheritSleep() { GrizzlyBear grizzly = new GrizzlyBear(true, 1000, 6, "brown", true); string result = grizzly.Sleep(); Assert.Equal("I sleep when I'm tired because I'm warm blooded", result); }
public void GrizzlyBear_is_an_animal_and_a_mammal() { // Arrange GrizzlyBear bear = new GrizzlyBear(); // Assert Assert.True(bear is Animal); }
public void Bear_has_name_diet_sound_home() { // Arrange GrizzlyBear bear = new GrizzlyBear(); // Assert Assert.Equal("Roar", bear.Sound); Assert.Equal("Omnivore", bear.Diet); Assert.Equal("Grizzly Bear", bear.Name); Assert.Equal("Cave", bear.Home); }
static void Main(string[] args) { BlackWidow charlotte = new BlackWidow(); charlotte.name = "charlotte"; Eagle ernest = new Eagle(); ernest.name = "ernest"; GrizzlyBear willis = new GrizzlyBear(); willis.name = "willis"; HumpbackWhale karl = new HumpbackWhale(); karl.name = "karl"; Mallard cheryl = new Mallard(); cheryl.name = "cheryl"; SiberianTiger goliath = new SiberianTiger(); goliath.name = "goliath"; Console.WriteLine($"Helo my name is {goliath.name}"); Console.WriteLine(goliath.Reproduction(goliath.reproduction)); Console.WriteLine(goliath.Diet(goliath.diet)); Console.WriteLine("\n"); Console.WriteLine($"Helo my name is {cheryl.name}"); Console.WriteLine(cheryl.Reproduction(cheryl.reproduction)); Console.WriteLine(cheryl.Diet(cheryl.diet)); Console.WriteLine("\n"); Console.WriteLine($"Helo my name is {karl.name}"); Console.WriteLine(karl.Reproduction(karl.reproduction)); Console.WriteLine(karl.Diet(karl.diet)); Console.WriteLine("\n"); Console.WriteLine($"Helo my name is {willis.name}"); Console.WriteLine(willis.Reproduction(willis.reproduction)); Console.WriteLine(willis.Diet(willis.diet)); Console.WriteLine("\n"); Console.WriteLine($"Helo my name is {ernest.name}"); Console.WriteLine(ernest.Reproduction(ernest.reproduction)); Console.WriteLine(ernest.Diet(ernest.diet)); Console.WriteLine("\n"); Console.WriteLine($"Helo my name is {charlotte.name}"); Console.WriteLine(charlotte.Legs(charlotte.legCount)); Console.WriteLine(charlotte.Exterior(charlotte.exterior, charlotte.segmentedBody)); Console.WriteLine("\n"); Console.WriteLine("Thank you come again!"); Console.Read(); }
static void Main(string[] args) { Crocodile crocodile = new Crocodile("large", true, 4, "green"); Horse horse = new Horse(6, true, 8, "yellow"); GrizzlyBear grizzly = new GrizzlyBear(true, 1000, 6, "brown", true); Lion lion = new Lion(true, 8, 3, "tan", true); Sloth sloth = new Sloth(500, "slow", 10, "grey"); Snake cobra = new Snake(11, "highly venomous", 3, "black"); crocodile.Sleep(); grizzly.Sleep(); horse.Sweat(); lion.Sweat(); }
/// <summary> /// Initializes a new instance of the /// <see cref="StudentPiER.StudentCode"/> class. /// </summary> /// <param name='robot'> /// The Robot to associate with this StudentCode /// </param> public StudentCode(Robot robot) { Debug.Print("hello"); this.robot = robot; this.stopwatch = new Stopwatch(); this.stopwatch.Start(); this.useRfid = true; if (this.useRfid) { this.rfid = new Rfid(robot); } this.leftMotor = new GrizzlyBear(robot, Watson.Motor.M0); this.rightMotor = new GrizzlyBear(robot, Watson.Motor.M1); this.gearbox = new GrizzlyBear(robot, Watson.Motor.M2, 0, 100, true); this.sonar = new AnalogSonarDistanceSensor(robot, Watson.Analog.A5); this.doorController = new MicroMaestro(robot, 12); this.motorDoor = new ServoMotor(robot, doorController,0,2400,9600); this.leftEncoder = new GrizzlyEncoder(10, leftMotor, robot); this.rightEncoder = new GrizzlyEncoder(10, rightMotor, robot); }
/// <summary> /// Initializes a new instance of the /// <see cref="StudentPiER.StudentCode"/> class. /// </summary> /// <param name='robot'> /// The Robot to associate with this StudentCode /// </param> public StudentCode(Robot robot) { this.robot = robot; this.stopwatch = new Stopwatch(); this.stopwatch.Start(); this.useRfid = true; if (this.useRfid) { this.rfid = new Rfid(robot); } this.leftMotor = new GrizzlyBear(robot, Watson.Motor.M0); this.rightMotor = new GrizzlyBear(robot, Watson.Motor.M1); this.sonar = new AnalogSonarDistanceSensor(robot, Watson.Analog.A5); this.leftEncoder = new GrizzlyEncoder(1, leftMotor, robot); this.rightEncoder = new GrizzlyEncoder(1, rightMotor, robot); }
//for hopper delay //private Boolean dump; //private Boolean notDump; //For stage 3 autonomous //private int n; /// <summary> /// Initializes a new instance of the /// <see cref="StudentPiER.StudentCode"/> class. /// </summary> /// <param name='robot'> /// The Robot to associate with this StudentCode /// </param> public StudentCode(Robot robot) { this.robot = robot; this.stopwatch = new Stopwatch(); this.stopwatch.Start(); this.useRfid = false; /*if (this.useRfid) { this.rfid = new Rfid(robot); }*/ this.leftMotor = new GrizzlyBear(robot, Watson.Motor.M0); this.rightMotor = new GrizzlyBear(robot, Watson.Motor.M1); this.conveyorBeltMotor = new GrizzlyBear(robot, Watson.Motor.M3); this.hopperMotor = new GrizzlyBear(robot, Watson.Motor.M2); this.sonar = new AnalogSonarDistanceSensor(robot, Watson.Analog.A5); this.leftEncoder = new GrizzlyEncoder(Step, this.leftMotor, this.robot); this.rightEncoder = new GrizzlyEncoder(Step, this.rightMotor, this.robot); this.servoSwitch = new DigitalLimitSwitch(robot, Watson.Digital.D1); this.autonomousSwitch = new DigitalLimitSwitch(robot, Watson.Digital.D3); this.StartTime = true; this.mm = new MicroMaestro(robot, 12); this.servo0 = new ServoMotor(robot, mm, 0, 500, 2000); //this.dump = true; //this.notDump = false; //this.n = 0; }
public void GrizzlyTest() { GrizzlyBear grizzly = new GrizzlyBear(); Assert.Equal("I eat berries fish insects .", grizzly.Eat(grizzly.diet)); }