Пример #1
0
        public void ANonApproverCannnotRejectLeave()
        {
            var leave = new LeaveItem
            {
                Status = LeaveItemStatus.AwaitingApproval
            };

            var approver = new User
            {
                IsApprover = false
            };

            var sut = CreateSut(approver);

            sut.Reject(leave);

            Assert.AreEqual(LeaveItemStatus.AwaitingApproval, leave.Status);
        }
Пример #2
0
        public void AnApproverCanApproveLeave()
        {
            var leave = new LeaveItem
            {
                Status = LeaveItemStatus.AwaitingApproval
            };
            
            var approver = new User
            {
                IsApprover = true
            };

            var sut = CreateSut(approver);
            
            sut.Approve(leave);

            Assert.AreEqual(LeaveItemStatus.Approved, leave.Status);
        }