public void TestGetFromStoreMongoDbRepository() { var obj = new RushObject("Player"); obj["Name"] = "John Doe"; var store = new StoreMongoDbRepository(); store.Resource = obj.ClassName; store.Insert(obj); var fromDb = store.Get(obj.ObjectId); Assert.IsNotNull(fromDb); }
public void TestUpdateStoreMongoDbRepository() { var obj = new RushObject("Player"); obj["Name"] = "John Doe"; var store = new StoreMongoDbRepository(); store.Resource = obj.ClassName; store.Insert(obj); obj["UpdateWorks"] = true; store.Update(obj.ObjectId, obj); Assert.IsNotNull(obj["UpdateWorks"]); }
public void TestInsertIntoStoreMongoDbRepository() { var obj = new RushObject("Player"); obj["Name"] = "John Doe"; obj["Score"] = 1000; obj["Array"] = new string[] { "A", "B", "C" }; var store = new StoreMongoDbRepository(); store.Resource = obj.ClassName; store.Insert(obj); Assert.IsNotNull(obj.ObjectId); Assert.IsNotNull(obj.CreatedAt); }
public void TestDeleteStoreMongoDbRepository() { var obj = new RushObject("Player"); obj["Name"] = "John Doe"; var store = new StoreMongoDbRepository(); store.Resource = obj.ClassName; store.Insert(obj); store.Delete(obj.ObjectId); var result = store.Get(obj.ObjectId); Assert.IsNull(result); }
public static void RegisterClassMap() { var pack = new ConventionPack { new CamelCaseElementNameConvention(), }; ConventionRegistry.Register("camel case", pack, t => true); CouponMongoDbRepository.RegisterClassMap(); CategoryMongoDbRepository.RegisterClassMap(); StoreMongoDbRepository.RegisterClassMap(); AffiliateCategoryMongoDbRepository.RegisterClassMap(); AffiliateCategoryMatchesMongoDbRepository.RegisterClassMap(); AffiliateStoreMongoDbRepository.RegisterClassMap(); AffiliateStoreMatchesMongoDbRepository.RegisterClassMap(); AffiliateCouponMongoDbRepository.RegisterClassMap(); AffiliateCouponMatchesMongoDbRepository.RegisterClassMap(); }