public void UserState() { var db = new InMemoryDatabase(); var uniform = UniformDatabase.Create(config => config .RegisterDocuments(typeof(UserView).Assembly) .RegisterDatabase(ViewDatabases.Mongodb, db)); var viewDb = new ViewDatabase(uniform); viewDb.Users.Save(new UserView() { Id = "me1", UserName = "******" }); var storedUser = db.GetCollection <UserView>(ViewCollections.Users).GetById("me1"); Assert.AreEqual("me1", storedUser.Id); Assert.AreEqual("User Name", storedUser.UserName); }
public void SetUp() { IContainer container = ObjectFactory.Container; Table = new GameTableAggregate(); Table.Setup(new GameTableState(), 0); var db = new InMemoryDatabase(); var uniform = UniformDatabase.Create(config => config .RegisterDocuments(typeof(UserView).Assembly) .RegisterDatabase(ViewDatabases.Mongodb, db)); View = new ViewDatabase(uniform); container.Configure(x => x.For <ViewDatabase>().Use(View)); Dispatcher = Dispatcher.Create(d => d .AddHandlers(typeof(UserView).Assembly, new[] { "Poker.Handlers.ViewHandlers", "Poker.Handlers.ViewHandlers" }) .SetServiceLocator(new StructureMapServiceLocator(container))); }
public PatientViewHandler(ViewDatabase database) { _patients = database.Patients; }
public TableHubEventHandler(ViewDatabase db) { _db = db; }
public SubjectHistoryViewHandler(ViewDatabase database) { _subjects = database.Subjects; _history = database.SubjectsHistory; }
public GameHubEventHandler(ViewDatabase db) { _db = db; }
public SiteHistoryViewHandler(ViewDatabase database) { _sites = database.Sites; _history = database.SitesHistory; }
public TableViewHandler(ViewDatabase db) { _db = db; _tables = db.Tables; }
public UserViewHandler(ViewDatabase db) { _db = db; _users = db.Users; }
public SiteViewHandler(ViewDatabase database) { _sites = database.Sites; }
public SubjectReducedViewHandler(ViewDatabase database) { _subjects = database.SubjectsReduced; }
public SiteViewHandler(ViewDatabase db) { _sites = db.Sites; }
public SubjectViewHandler(ViewDatabase database) { _sites = database.Sites; _subjects = database.Subjects; }