public void TestBasicReisAddGetUpdateDelete()
        {
            //Add-Get-Тест
            DateTime date = DateTime.Now;
            BasicReis expectedBasicReis = new BasicReis();
            expectedBasicReis.Date = date;

            DataAccessBasicReis basicReis = new DataAccessBasicReis();
            basicReis.AddElement(expectedBasicReis);
            var actualBasicReis = basicReis.GetAll().Last();
            Assert.AreEqual(expectedBasicReis, actualBasicReis);

            //Update - Тест
            expectedBasicReis = actualBasicReis;
            expectedBasicReis.Date = date.AddDays(2);
            basicReis.UpdateElement(expectedBasicReis);
            actualBasicReis = basicReis.GetElement(expectedBasicReis.CodeBasicReis);
            Assert.AreEqual(expectedBasicReis, actualBasicReis);

            //Delete-Тест
            int expectedCount = basicReis.GetAll().Count() - 1;
            basicReis.DeleteElement(actualBasicReis);
            int actualCount = basicReis.GetAll().Count();
            Assert.AreEqual(expectedCount, actualCount);
        }
Esempio n. 2
0
 private void detach_BasicReis(BasicReis entity)
 {
     this.SendPropertyChanging();
     entity.Plains = null;
 }
Esempio n. 3
0
 private void attach_BasicReis(BasicReis entity)
 {
     this.SendPropertyChanging();
     entity.Plains = this;
 }
Esempio n. 4
0
 partial void DeleteBasicReis(BasicReis instance);
Esempio n. 5
0
 partial void UpdateBasicReis(BasicReis instance);
Esempio n. 6
0
 partial void InsertBasicReis(BasicReis instance);
		private void detach_BasicReis(BasicReis entity)
		{
			this.SendPropertyChanging();
			entity.Plains = null;
		}
		private void attach_BasicReis(BasicReis entity)
		{
			this.SendPropertyChanging();
			entity.Plains = this;
		}
 partial void DeleteBasicReis(BasicReis instance);
 partial void UpdateBasicReis(BasicReis instance);
 partial void InsertBasicReis(BasicReis instance);