public void TestEngine()
        {
            // Arrange
            motor = new Engine();

            // Act
            string engineAboutPreStart = motor.About();

            bool originalEngineStatus = motor.isStarted;

            motor.Start();
            bool   postEngineStartStatus = motor.isStarted;
            string engineAboutPostStart  = motor.About();

            motor.Stop();
            bool postEngineStopStatus = motor.isStarted;


            // Assert
            Assert.AreEqual(false, originalEngineStatus);
            Assert.AreEqual(true, postEngineStartStatus);
            Assert.AreEqual(false, postEngineStopStatus);
            Assert.AreEqual("Engine Started: False", engineAboutPreStart);
            Assert.AreEqual("Engine Started: True", engineAboutPostStart);
        }
Exemplo n.º 2
0
        public void About()
        {
            Engine engine = new Engine();

            Assert.AreEqual(engine.About(), "It's not started");

            engine.Start();

            Assert.AreEqual(engine.About(), "It's started");
        }
Exemplo n.º 3
0
        public void TestAboutString()
        {
            Engine e = new Engine();

            string aboutStringEngineOff = e.About();//upon construction, the engine should be false

            e.Start();
            string aboutStringEngineOn = e.About();

            Assert.AreEqual("The engine is not started.", aboutStringEngineOff);
            Assert.AreEqual("The engine is started.", aboutStringEngineOn);
        }
        public void EngineAbout()
        {
            //Arrange
            string afterAbout;

            //Act
            afterAbout = engine.About();

            //Assert
            Assert.IsNotNull(engine);
            Assert.AreEqual(afterAbout, engine.About());
            Assert.AreNotEqual(afterAbout, string.Empty);
        }
        public void EngineAbout()
        {
            //
            Engine testEngine = new Engine();
            string about      = testEngine.About();

            Assert.AreEqual(about, testEngine + " engine is not started");
            //
            testEngine.Start();
            about = testEngine.About();
            Assert.AreEqual(about, testEngine + " engine is started");
            //
        }
        public void EngineStartCheck()
        {
            //arrange
            Engine engine = new Engine();

            //assert - engine should not be on
            Assert.AreEqual(engine.About(), $"{engine} is not started\n");

            //act - turn that beauty on
            engine.Start();

            //assert - engine better be on by now
            Assert.IsTrue(engine.isStarted);

            //assert - let's check the about
            Assert.AreEqual(engine.About(), $"{engine} is started\n");
        }
Exemplo n.º 7
0
        public void TestEngineAbout()
        {
            //Arrange
            e = new Engine();
            //Act
            string originalEngineStateString = e.About();

            e.Start();
            string EngineStateOnString = e.About();

            e.Stop();
            string EngineStateOffString = e.About();

            //Assert
            Assert.AreNotEqual(EngineStateOnString, originalEngineStateString);
            Assert.AreEqual(EngineStateOffString, originalEngineStateString);
        }
Exemplo n.º 8
0
        public void TestEngineAbout()
        {
            //arrange
            e = new Engine();

            //assert
            Assert.AreEqual(e + " is not started", e.About()); //test to see if engine default about is true
        }
        public void EngineAbout()
        {
            //Arrange
            Engine e = new Engine();
            //Act
            string defaultEngineAbout = e.About();

            e.Start();
            string startedAbout = e.About();

            e.Stop();
            string stoppedAbout = e.About();

            //Assert
            Assert.AreEqual(defaultEngineAbout, $"{e.ToString()} is not started.");
            Assert.AreEqual(startedAbout, $"{e.ToString()} is started.");
            Assert.AreEqual(stoppedAbout, $"{e.ToString()} is not started.");
        }
Exemplo n.º 10
0
        public void EngineTestAbout()
        {
            // Setup

            Engine e = new Engine();

            string defaultAbout = e.About();

            e.Start();
            string startAbout = e.About();

            e.Stop();
            string stopAbout = e.About();

            // Tests
            Assert.AreEqual(defaultAbout, "This engine has not been started");
            Assert.AreEqual(startAbout, "This engine has been started");
            Assert.AreEqual(stopAbout, "This engine has not been started");
        }
        public void About()
        {
            // About not started formatting check.
            // Arrange.
            engine = new Engine();
            // Act.
            string about = engine.About();

            // Assert.
            Assert.AreEqual($"{engine} is not started.", about);

            // About started formatting check.
            // Arrange.
            engine = new Engine();
            engine.Start();
            // Act.
            about = engine.About();
            // Assert.
            Assert.AreEqual($"{engine} is started.", about);
        }
        public void EngineStopCheck()
        {
            //arrange
            Engine engine = new Engine();

            //act - turn that beauty on
            engine.Start();

            //assert - engine better be on by now
            Assert.IsTrue(engine.isStarted);

            //act - goodnight sweet prince :)
            engine.Stop();

            //assert - engine is now off
            Assert.IsFalse(engine.isStarted);

            //assert - let's check the about
            Assert.AreEqual(engine.About(), $"{engine} is not started\n");
        }
Exemplo n.º 13
0
 /// <summary>
 /// A message about this vehicle.
 /// </summary>
 /// <returns>A string containing state about this vehicle.</returns>
 public virtual string About()
 => $"This {this} has a max altitude of {MaxAltitude} {ELEVATION_UNIT}." +
 Environment.NewLine +
 $"Its current altitude is {CurrentAltitude} {ELEVATION_UNIT}." +
 Environment.NewLine +
 Engine.About();