Exemplo n.º 1
0
        public async System.Threading.Tasks.Task GetTaskByIdAsync_ManageMemberWorkingDaysServiceReturnsId1_ReturnsId1()
        {
            //Arrange
            const int memberWorkingDaysId = 1;
            var       memberWorkingDays   = new List <MemberWorkingDays>()
            {
                new MemberWorkingDays {
                    Id = 1, MemberId = 1, SprintId = 1, WorkingDays = 21
                }
            };
            var mock = memberWorkingDays.AsQueryable().BuildMock();

            _memberWorkingDaysRepository.Setup(x => x.GetAll()).Returns(mock.Object);

            //Act
            var result = await _manageMemberWorkingDaysService.GetWorkingDaysByIdAsync(memberWorkingDaysId);

            //Assert
            Assert.AreEqual(memberWorkingDaysId, result.Id);
        }
        public async System.Threading.Tasks.Task GetTaskByIdAsync_ManageMemberWorkingDaysServiceReturnsId1_ReturnsId1()
        {
            //Arrange
            const int memberWorkingDaysId = 1;
            Sprint    sprint            = Sprint.Create(1, new List <Task>());
            var       memberWorkingDays = new List <MemberWorkingDays>()
            {
                MemberWorkingDays.Create(1, 1, 1, sprint, 21)
            };
            var mock = memberWorkingDays.AsQueryable().BuildMock();

            _memberWorkingDaysRepository.Setup(x => x.GetAllAsync())
            .Returns(System.Threading.Tasks.Task.FromResult(memberWorkingDays.AsEnumerable()));

            //Act
            var result = await _manageMemberWorkingDaysService.GetWorkingDaysByIdAsync(memberWorkingDaysId);

            //Assert
            Assert.AreEqual(memberWorkingDaysId, result.Id);
        }