public void Init() { this.ConfigureMapper(); this.feedbacks = new List <Feedback>() { new Feedback() { Id = 1, Topic = "Cmoon", Content = "VolgaVolgaVolgaVolgaVolgaVolgaVolga" }, new Feedback() { Id = 2, Topic = "Cmoon", Content = "VolgaVolgaVolgaVolgaVolgaVolgaVolga" } }; this.context = new FakeTechJunkDbContext(); foreach (var feedback in this.feedbacks) { this.context.Feedbacks.Add(feedback); } var fakeHttpContext = new Mock <HttpContextBase>(); var fakeIdentity = new GenericIdentity("User"); var principal = new GenericPrincipal(fakeIdentity, new string[] { "Admin" }); fakeHttpContext.Setup(t => t.User).Returns(principal); var controllerContext = new Mock <ControllerContext>(); controllerContext.Setup(t => t.HttpContext).Returns(fakeHttpContext.Object); this.service = new HomeService(this.context); this.controller = new HomeController(this.service); this.controller.ControllerContext = controllerContext.Object; }
public AdminUsersService(ITechJunkDbContext context) : base(context) { }
public InterestsService(ITechJunkDbContext context) : base(context) { }
public AdminFeedbackService(ITechJunkDbContext context) : base(context) { }
public HomeService(ITechJunkDbContext context) : base(context) { }
public SalesService(ITechJunkDbContext context) : base(context) { }
public Service(ITechJunkDbContext context) { this.Context = context; }
public MessagesService(ITechJunkDbContext context) : base(context) { }