/// <summary>
        /// Create a new Merk object.
        /// </summary>
        /// <param name="id">Initial value of the Id property.</param>
        public static Merk CreateMerk(global::System.String id)
        {
            Merk merk = new Merk();

            merk.Id = id;
            return(merk);
        }
Beispiel #2
0
        public void DeleteMerk()
        {
            //Add first to make data dummy
            _repository.Add(merkStub1);
            _repository.SaveChanges();

            //Delete
            _repository.Delete(merkStub1);
            _repository.SaveChanges();

            //make sure wheter data is no longer in database
            merk = _repository.GetById(merkStub1.Id);
            Assert.IsNull(merk, "Merk Belum Terhapus");
        }
        public MerkServiceResponse Create(MerkDomain merk)
        {
            MerkServiceResponse response = new MerkServiceResponse();

            if (validateMandatoryField(merk))
            {
                response.Messages.Add(new Message("Mandatory fields is empty"));
            }
            else if (!validateIsNotExist(merk.Id.OwnerId))
            {
                #region TO DO Create Unit Test
                response.Messages.Add(new Message("Data is already on database"));
                #endregion
            }
            else
            {
                merkEntity = new Merk();
                MergeExtension.Merge(merkEntity, merk);
                _merkRepository.Add(merkEntity);
                _merkRepository.SaveChanges();
            }

            return response;
        }
 /// <summary>
 /// Create a new Merk object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 public static Merk CreateMerk(global::System.String id)
 {
     Merk merk = new Merk();
     merk.Id = id;
     return merk;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the Merks EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToMerks(Merk merk)
 {
     base.AddObject("Merks", merk);
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the Merks EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToMerks(Merk merk)
 {
     base.AddObject("Merks", merk);
 }
Beispiel #7
0
        public void InsertTest()
        {
            //Add first
            _repository.Add(merkStub1);
            _repository.SaveChanges();

            //Check whether on database or not
            merk = _repository.GetById(merkStub1.Id);
            Assert.IsNotNull(merk, "Merk Berhasil Terbuat");

            //Delete so this method can be used again
            _repository.Delete(merkStub1);
            _repository.SaveChanges();
        }
Beispiel #8
0
 public void GetByIdMerkTest()
 {
     merk = _repository.GetById("X");
     Assert.IsNotNull(merk);
 }
Beispiel #9
0
        public void UpdateTest()
        {
            _repository.Update(merkUpdateStub);
            _repository.SaveChanges();
            merk =_repository.GetById(merkUpdateStub.Id);

            Assert.AreEqual(merkUpdateStub.Id, merk.Id);
        }