示例#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());
        }
        public void AddPosition_WithValidArguments_NewChangeAddChangesReterned()
        {
            //Arrange
            var             Changes = new List <Change>();
            Change          NewChange;
            List <Position> ListPositions = new List <Position>();
            int             NumOrd        = 1;

            NewChange = employee.Recruitment(NumOrd, N1Pos1);
            Changes.Add(NewChange);
            ListPositions.Add(N1Pos1);
            NumOrd = 2;
            //ACT
            NewChange = employee.AddPosition(NumOrd, N2Pos1);
            Changes.Add(NewChange);
            ListPositions.Add(N2Pos1);

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

            Assert.IsNull(NewChange.GetPreviousChange());
            Assert.AreEqual(NumOrd, NewChange.GetNumberOrder());
            Assert.AreEqual(N2Pos1, NewChange.GetPosition());
            Assert.AreEqual(employee, NewChange.GetEmployee());
            Assert.IsTrue(NewChange.GetIsCombination());
            Assert.IsTrue(NewChange.GetStatus());
            Assert.AreEqual(RecordType.Найм, NewChange.GetRecordType());
        }
示例#3
0
        public void Recruitment_WithValidArgumentsComPos_NewChangeReterned()
        {
            //Arrange
            Change NewChange;
            int    NumOrd = 1;

            //ACT
            NewChange = Change.Recruitment(NumOrd, employee1, N1Pos1, true);

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

            Assert.IsNull(NewChange.GetPreviousChange());
            Assert.AreEqual(NumOrd, NewChange.GetNumberOrder());
            Assert.AreEqual(N1Pos1, NewChange.GetPosition());
            Assert.AreEqual(employee1, NewChange.GetEmployee());
            Assert.IsTrue(NewChange.GetIsCombination());
            Assert.IsTrue(NewChange.GetStatus());
            Assert.AreEqual(RecordType.Найм, NewChange.GetRecordType());
        }