Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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)));
        }
Esempio n. 3
0
 public PatientViewHandler(ViewDatabase database)
 {
     _patients = database.Patients;
 }
Esempio n. 4
0
 public TableHubEventHandler(ViewDatabase db)
 {
     _db = db;
 }
 public SubjectHistoryViewHandler(ViewDatabase database)
 {
     _subjects = database.Subjects;
     _history = database.SubjectsHistory;
 }
Esempio n. 6
0
 public GameHubEventHandler(ViewDatabase db)
 {
     _db = db;
 }
 public SiteHistoryViewHandler(ViewDatabase database)
 {
     _sites = database.Sites;
     _history = database.SitesHistory;
 }
Esempio n. 8
0
 public TableViewHandler(ViewDatabase db)
 {
     _db     = db;
     _tables = db.Tables;
 }
Esempio n. 9
0
 public UserViewHandler(ViewDatabase db)
 {
     _db    = db;
     _users = db.Users;
 }
Esempio n. 10
0
 public SiteViewHandler(ViewDatabase database)
 {
     _sites = database.Sites;
 }
 public SubjectReducedViewHandler(ViewDatabase database)
 {
     _subjects = database.SubjectsReduced;
 }
 public SiteViewHandler(ViewDatabase db)
 {
     _sites = db.Sites;
 }
Esempio n. 13
0
 public SubjectViewHandler(ViewDatabase database)
 {
     _sites = database.Sites;
     _subjects = database.Subjects;
 }