/// <summary> /// Create a new HeadOffice object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="name">Initial value of the Name property.</param> public static HeadOffice CreateHeadOffice(global::System.Guid id, global::System.String name) { HeadOffice headOffice = new HeadOffice(); headOffice.Id = id; headOffice.Name = name; return(headOffice); }
public void AddHeadOfficeTest() { //Add first _repository.Add(headOfficeStub1); _repository.SaveChanges(); //Check whether on database or not headOffice = _repository.GetById(headOfficeStub1.Id); Assert.IsNotNull(headOffice, "Data Head Office Baru Berhasil Terbuat"); //Delete so this method can be used again _repository.Delete(headOfficeStub1); _repository.SaveChanges(); }
public HeadOfficeServiceResponse Create(HeadOfficeDomain headOffice) { HeadOfficeServiceResponse response = new HeadOfficeServiceResponse(); if (!validateIsNotExist(headOffice.Id)) response.Messages.Add(new Message("Data is already on database")); else { headOfficeEntity = new HeadOffice(); MergeExtension.Merge(headOfficeEntity, headOffice); _headOfficeRepository.Add(headOfficeEntity); _headOfficeRepository.SaveChanges(); } return response; }
/// <summary> /// Create a new HeadOffice object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="name">Initial value of the Name property.</param> public static HeadOffice CreateHeadOffice(global::System.Guid id, global::System.String name) { HeadOffice headOffice = new HeadOffice(); headOffice.Id = id; headOffice.Name = name; return headOffice; }
/// <summary> /// Deprecated Method for adding a new object to the HeadOffices EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToHeadOffices(HeadOffice headOffice) { base.AddObject("HeadOffices", headOffice); }
/// <summary> /// Deprecated Method for adding a new object to the HeadOffices EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToHeadOffices(HeadOffice headOffice) { base.AddObject("HeadOffices", headOffice); }
public void DeleteHeadOfficeTest() { //Add first to make data dummy _repository.Add(headOfficeStub1); _repository.SaveChanges(); //Delete _repository.Delete(headOfficeStub1); _repository.SaveChanges(); //make sure wheter data is no longer in database headOffice = _repository.GetById(headOfficeStub1.Id); Assert.IsNull(headOffice, "Head Office Terhapus"); }
public void UpdateNullHeadOfficeTest() { _repository.Update(headOfficeUpdateStub1); _repository.SaveChanges(); headOffice = _repository.GetById(headOfficeUpdateStub1.Id); }
public void UpdateHeadOfficeTest() { //precondition _repository.Add(headOfficeInsertStub1); _repository.SaveChanges(); _repository.Update(headOfficeUpdateStub1); _repository.SaveChanges(); headOffice = _repository.GetById(headOfficeUpdateStub1.Id); Assert.AreEqual(headOffice.Address, headOfficeUpdateStub1.Address); //delete data _repository.Delete(headOfficeUpdateStub1); _repository.SaveChanges(); }