private PlateManufacturer ImportPlateManifacturer(PlateManufacturerObject plateManufacturerObj) { if (plateManufacturerObj == null) { return(null); } bool isNew = false; PlateManufacturer manufacturer = importRepo.PlateManufacturerRepo.Get(plateManufacturerObj.Id); if (manufacturer == null) { manufacturer = new PlateManufacturer(); isNew = true; } manufacturer.Id = plateManufacturerObj.Id; manufacturer.Name = plateManufacturerObj.Name; manufacturer.IsActive = plateManufacturerObj.IsActive; manufacturer.IsNative = false; manufacturer.Project = ImportProject(plateManufacturerObj.Project); if (isNew) { importRepo.PlateManufacturerRepo.Save(manufacturer); } else { importRepo.PlateManufacturerRepo.SaveOrUpdate(manufacturer); } return(manufacturer); }
public void TestPlateManufacturerCopyConstructor() { PlateManufacturerObject obj = new PlateManufacturerObject(SetupMock()); AssertPlateManufacturer(obj); }
public void TestPlateManufacturerCasting() { PlateManufacturerObject obj = SetupMock(); AssertPlateManufacturer(obj); }
void AssertPlateManufacturer(PlateManufacturerObject obj) { Assert.AreEqual(id, obj.Id); Assert.AreEqual(NAME, obj.Name); Assert.IsTrue(obj.IsActive); }