Ejemplo n.º 1
0
      public void TestSemiUnLoadProductThrowsExceptionWhenEmpty()
      {
          Vehicle semi      = new Semi();
          Product hardDrive = new HardDrive(120);

          semi.LoadProduct(new Gpu(100));
          semi.Unload();
          Assert.Throws <InvalidOperationException>(() => semi.Unload(), "Empty Semi still unloads products.");
      }
Ejemplo n.º 2
0
        public void TestUnloadProduct()
        {
            Vehicle vehicle = new Semi();

            vehicle.LoadProduct(new Gpu(5));
            vehicle.Unload();

            Assert.AreEqual(0, vehicle.Trunk.Count);
        }
Ejemplo n.º 3
0
      public void TestSemiUnLoadProductUnloadsTheCorretItem()
      {
          Vehicle semi = new Semi();

          Product hardDrive = new HardDrive(120);

          semi.LoadProduct(new Gpu(100));
          semi.LoadProduct(hardDrive);
          Assert.AreEqual(semi.Unload(), hardDrive);
      }