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