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); }
public void TestSemiPropertyIsFullReturnsCorrectValueWhenFull() { Vehicle semi = new Semi(); Product hardDrive = new HardDrive(120); semi.LoadProduct(hardDrive); semi.LoadProduct(hardDrive); semi.LoadProduct(hardDrive); semi.LoadProduct(hardDrive); semi.LoadProduct(hardDrive); semi.LoadProduct(hardDrive); semi.LoadProduct(hardDrive); semi.LoadProduct(hardDrive); semi.LoadProduct(hardDrive); semi.LoadProduct(hardDrive); Assert.True(semi.IsFull, "Semi should be full"); }
public void TestSemiPropertyIsFullReturnsCorrectValueWhenNotFull() { Vehicle semi = new Semi(); Product hardDrive = new HardDrive(120); semi.LoadProduct(new Gpu(100)); Assert.False(semi.IsFull, "Semi should not be full"); }
public void TestSemiPropertyIsEmptyReturnsCorrectValueWhenNotEmpty() { Vehicle semi = new Semi(); Product hardDrive = new HardDrive(120); semi.LoadProduct(new Gpu(100)); Assert.IsFalse(semi.IsEmpty, "Semi should not be empty"); }
public void TestLoadProduct() { Vehicle vehicle = new Semi(); vehicle.LoadProduct(new Gpu(5)); Assert.AreEqual(1, vehicle.Trunk.Count); }
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."); }
public void TestSemiLoadProductLoadsItems() { Vehicle semi = new Semi(); Product gpu = new Gpu(120); semi.LoadProduct(gpu); Assert.AreEqual(semi.Trunk.First(), gpu, "Semi does not add products correctly."); }
public void TestSemiTrunkReturnsCorrectCollection() { Vehicle semi = new Semi(); Product hardDrive = new HardDrive(120); Product gpu = new Gpu(100); Product ram = new Ram(40); List <Product> products = new List <Product>() { hardDrive, gpu, ram, }; semi.LoadProduct(hardDrive); semi.LoadProduct(gpu); semi.LoadProduct(ram); CollectionAssert.AreEqual(semi.Trunk, products, "Added items should be the same."); }
public void TestSemiLoadProductThrowsExceptionWhenFull() { Vehicle semi = new Semi(); Product hardDrive = new HardDrive(120); semi.LoadProduct(hardDrive); semi.LoadProduct(hardDrive); semi.LoadProduct(hardDrive); semi.LoadProduct(hardDrive); semi.LoadProduct(hardDrive); semi.LoadProduct(hardDrive); semi.LoadProduct(hardDrive); semi.LoadProduct(hardDrive); semi.LoadProduct(hardDrive); semi.LoadProduct(hardDrive); Assert.Throws <InvalidOperationException>(() => semi.LoadProduct(hardDrive), "Full Semi does not throw exception."); }