コード例 #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.");
      }
コード例 #2
0
        public void TestUnloadProduct()
        {
            Vehicle vehicle = new Semi();

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

            Assert.AreEqual(0, vehicle.Trunk.Count);
        }
コード例 #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);
      }