Пример #1
0
        public void AddPositionReturnsDoctorPosition()
        {
            //Arrange
            positionRepository.Setup(s => s.Exists(It.IsAny <DoctorPosition>())).ReturnsAsync(default(DoctorPosition));
            positionRepository.Setup(s => s.Post(It.IsAny <DoctorPosition>())).ReturnsAsync(
                (DoctorPosition dp) => { return(dp); });
            long doctorId = 1;

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

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