Exemplo n.º 1
0
        public void GetDoctors_ShouldReturnAllDoctors()
        {
            GetDoctorsSetup();
            var response = _controller.GetDoctors();

            //verify return 2 objects
            response.Count().ShouldBeEquivalentTo(2);
            //verify exact match
            response.ShouldBeEquivalentTo(ExpectedDoctorList());
            //verify really call the queries
            _dapperMock.Verify(d => d.Query <Doctor>("RdssqlServerConnection", "GetDoctors", null), Times.Once);
            _dapperMock.Verify(d => d.Query <Specialties>("RdssqlServerConnection", "GetSpecialtiesByDoctorId", It.IsAny <object>()), Times.Exactly(2));
        }