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);
        }
Пример #2
0
 private void detach_BasicReis(BasicReis entity)
 {
     this.SendPropertyChanging();
     entity.Plains = null;
 }
Пример #3
0
 private void attach_BasicReis(BasicReis entity)
 {
     this.SendPropertyChanging();
     entity.Plains = this;
 }
Пример #4
0
 partial void DeleteBasicReis(BasicReis instance);
Пример #5
0
 partial void UpdateBasicReis(BasicReis instance);
Пример #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);