public void PresenterServiceGetPresenterTest()
        {
            var list = new List<Expert>();
            list.Add(new Expert() { ExpertId = 1, FirstName = "Troy", LastName = "Hunt", Description = "Long description" });
            list.Add(new Expert() { ExpertId = 2, FirstName = "Adam", LastName = "Cogan", Description = "Long description" });
            list.Add(new Expert() { ExpertId = 3, FirstName = "Adam", LastName = "Stephensen", Description = "Long description" });

            var data = list.AsQueryable();

            var mockSet = new Mock<DbSet<Expert>>();

            mockSet.As<IQueryable<Expert>>().Setup(m => m.Provider).Returns(data.Provider);
            mockSet.As<IQueryable<Expert>>().Setup(m => m.Expression).Returns(data.Expression);
            mockSet.As<IQueryable<Expert>>().Setup(m => m.ElementType).Returns(data.ElementType);
            mockSet.As<IQueryable<Expert>>().Setup(m => m.GetEnumerator()).Returns(data.GetEnumerator());

            var mockContext = new Mock<BookingEngineContext>();
            mockContext.Setup(n => n.Experts).Returns(mockSet.Object);

            var mockUnitOfWork = new Mock<DbUnitOfWork>(mockContext);

            var mockFactory = new Mock<IUnitOfWorkFactory>();
            mockFactory.Setup(n => n.Create()).Returns(mockUnitOfWork.Object);

            ExpertQryService svc = new ExpertQryService(mockFactory.Object);
            var model = svc.GetExpert("");

            Assert.IsNotNull(model);
            Assert.AreEqual(1, model.Id);
            Assert.AreEqual("Troy", model.FirstName);
            Assert.AreEqual("Hunt", model.LastName);
            Assert.AreEqual("Long description", model.Description);

            var model2 = svc.GetExpert("");
            Assert.IsNull(model2);
        }
 public ExpertController()
 {
     var factory = (IUnitOfWorkFactory)new SampleUnitOfWorkFactory();
     _expSvc = new ExpertQryService(factory);
 }
        public ExpertController(ExpertQryService expSvc)
        {
            _expSvc = expSvc;

        }