internal SiteState InitialiseSiteState() { SiteState.IsInitalised = false; ResponseBuilder.IsInitialised = false; MockContainer = new Mock <IContainer>(); MockContainer.Setup(m => m.RecordPersister <Pet>()).Returns(MockPetPersister.Object); MockContainer.Setup(m => m.RecordPersister <PetMetric>()).Returns(MockPetMetricPersister.Object); MockContainer.Setup(m => m.RecordPersister <UserPet>()).Returns(MockUserPetPersister.Object); return(SiteState.Initialise(Config, MockUsers.Object, MockPets.Object, MockAnimals.Object, MockInteractions.Object, MockMetrics.Object, MockUserDataProvider.Object, new SiteRequestProcessor(MockUserPersister.Object), MockContainer.Object)); }
protected void Application_Start(object sender, EventArgs e) { var config = new DatabaseConfiguration("NopePets"); var container = new Container(config); UserContainer = new UserSessionContainer(container, config); SiteState = SiteState.Initialise(config, container.SiteRepository <User, UserPet>(), container.SiteRepository <Pet, PetMetric>(), container.SiteRepository <Animal, AnimalMetric>(), container.SiteRepository <Interaction, MetricInteraction>(), container.SiteRepository <Metric, MetricInteraction>(), container.DataProvider <User>(), container.SiteRequestProcessor(), UserContainer); RouteTable.Routes.Add(new ServiceRoute("", new WebServiceHostFactory(), typeof(SiteService))); }