コード例 #1
0
        public void EditPositionRetunrsDoctorPosition()
        {
            //Arrange
            positionRepository.Setup(p => p.Exists(It.IsAny <object[]>())).ReturnsAsync(true);
            positionRepository.Setup(p => p.Put(It.IsAny <DoctorPosition>())).ReturnsAsync(
                (DoctorPosition dp) => { return(dp); });
            long doctorId   = 1;
            long positionId = doctorId + 1;

            //Act
            var result = (controller.EditPosition(doctorId, positionId, new DoctorPosition
            {
                DoctorId = doctorId,
                Id = positionId
            }).Result as OkObjectResult).Value;

            //Assert
            Assert.IsInstanceOfType(result, typeof(DoctorPosition));
            Assert.AreEqual(doctorId, (result as DoctorPosition)?.DoctorId);
            Assert.AreEqual(positionId, (result as DoctorPosition)?.Id);
        }