Example #1
0
        public void Dismissal_WithValidArgumentsSubPosition_NewChangeReterned()
        {
            //Arrange
            Change OldChange, NewChange;
            int    NumOrd = 1;

            OldChange = Change.Recruitment(NumOrd, employee1, N1Pos1, true);

            //ACT
            NumOrd    = 2;
            NewChange = Change.Dismissal(NumOrd, employee1, OldChange);

            //Assert
            Assert.IsTrue(Math.Abs(DateTime.Now.Ticks - NewChange.GetDateChange().Ticks) < 10000000);

            Assert.AreEqual(OldChange, NewChange.GetPreviousChange());
            Assert.AreEqual(NumOrd, NewChange.GetNumberOrder());
            Assert.IsNull(NewChange.GetPosition());
            Assert.AreEqual(employee1, NewChange.GetEmployee());
            Assert.IsTrue(NewChange.GetIsCombination());
            Assert.IsFalse(NewChange.GetStatus());
            Assert.AreEqual(RecordType.Увольнение, NewChange.GetRecordType());

            Assert.IsFalse(OldChange.GetStatus());
        }
Example #2
0
        public void Dismissal_WithValidArguments_NewChangeAddChangesReterned()
        {
            //Arrange
            var             Changes = new List <Change>();
            Change          NewChange, OldChange;
            List <Position> ListPositions = new List <Position>();
            int             NumOrd        = 1;

            OldChange = employee.Recruitment(NumOrd, N1Pos1);
            Changes.Add(OldChange);
            NumOrd = 2;

            //ACT
            NewChange = employee.Dismissal(NumOrd, N1Pos1);
            Changes.Add(NewChange);

            //Assert
            CollectionAssert.AreEqual(ListPositions, employee.GetListCurrentPositions().ToList());
            CollectionAssert.AreEqual(Changes, employee.GetChanges().ToList());

            Assert.AreEqual(OldChange, NewChange.GetPreviousChange());
            Assert.AreEqual(NumOrd, NewChange.GetNumberOrder());
            Assert.IsNull(NewChange.GetPosition());
            Assert.AreEqual(employee, NewChange.GetEmployee());
            Assert.IsFalse(NewChange.GetIsCombination());
            Assert.IsFalse(NewChange.GetStatus());
            Assert.AreEqual(RecordType.Увольнение, NewChange.GetRecordType());

            Assert.IsFalse(OldChange.GetStatus());
        }