Beispiel #1
0
        public void DeletePosition(DTOPosition position)
        {
            string error;

            if (!Position.DoesPositionExist(position, Positions, out error))
            {
                ThrowError(error);
                return;
            }
            positionListFeedBack.DeletePosition(position);
        }
Beispiel #2
0
        public void DoesPositionExistFail_DTOList()
        {
            var position1   = new DTOPosition(1, "1", "1");
            var position2   = new DTOPosition(2, "2", "2");
            var dTOposition = new DTOPosition(3, "2", "2");
            var positions   = new List <DTOPosition>()
            {
                position1, position2
            };
            var result = Position.DoesPositionExist(dTOposition, positions, out var error);

            Assert.IsFalse(result);
            Assert.AreEqual($"Position {dTOposition.Name} cannot be found", error);
        }
Beispiel #3
0
        public void DoesPositionExistSuccess_DTOList()
        {
            var position1   = new DTOPosition(1, "1", "1");
            var position2   = new DTOPosition(2, "2", "2");
            var dTOposition = new DTOPosition(1, "2", "2");
            var positions   = new List <DTOPosition>()
            {
                position1, position2
            };
            var result = Position.DoesPositionExist(dTOposition, positions, out var error);

            Assert.IsTrue(result);
            Assert.AreEqual($"Position {dTOposition.Name} already exists", error);
        }