public void SimpleBadgeEarned()
        {
            var plugin = new SVNPlugin();
            new LanguagePlugin().LoadDBMaps();
            plugin.LoadDBMaps();
            plugin.LoadBadges();
            plugin.Analyze();
            plugin.Compute();
            plugin.ComputeBadges();

            var manager = new DatabaseManager();
            var collection = manager.GetDatabase()
                .GetCollection<IUser>(typeof(IUser).Name)
                .FindAll()
                .ToList();

            Assert.AreEqual(1, collection.Count);

            foreach (var user in collection)
            {
                var badges = user.Badges;
                Assert.AreEqual(1, badges.Count);
                foreach (var badge in badges)
                {
                    Assert.AreEqual("Add!", badge.Name);
                }
            }

            
        }
Пример #2
0
        public void SimpleBadgeEarned()
        {
            var plugin = new SVNPlugin();

            new LanguagePlugin().LoadDBMaps();
            plugin.LoadDBMaps();
            plugin.LoadBadges();
            plugin.Analyze();
            plugin.Compute();
            plugin.ComputeBadges();

            var manager    = new DatabaseManager();
            var collection = manager.GetDatabase()
                             .GetCollection <IUser>(typeof(IUser).Name)
                             .FindAll()
                             .ToList();

            Assert.AreEqual(1, collection.Count);

            foreach (var user in collection)
            {
                var badges = user.Badges;
                Assert.AreEqual(1, badges.Count);
                foreach (var badge in badges)
                {
                    Assert.AreEqual("Add!", badge.Name);
                }
            }
        }
Пример #3
0
        public void DatabaseRegistryLevelUpTest()
        {
            var plugin = new SVNPlugin();

            plugin.Analyze();
            plugin.Compute();
            var db         = new DatabaseManager();
            var database   = db.GetDatabase();
            var collection = database.GetCollection <IUser>(typeof(IUser).Name);

            foreach (var user in collection.FindAll())
            {
                var exp = user.ExperiencePoints[typeof(SVNExperience).Name];
                Assert.AreEqual(Environment.UserName, exp.Name);
                Assert.AreEqual(2, exp.Level);
                Assert.AreEqual(20, exp.ExperiencePoints);
            }
        }
 public void DatabaseRegistryLevelUpTest()
 {
     var plugin = new SVNPlugin();
     plugin.Analyze();
     plugin.Compute();
     var db = new DatabaseManager();            
     var database = db.GetDatabase();            
     var collection = database.GetCollection<IUser>(typeof(IUser).Name);
     foreach (var user in collection.FindAll())
     {
         var exp = user.ExperiencePoints[typeof(SVNExperience).Name];                
         Assert.AreEqual(Environment.UserName, exp.Name);
         Assert.AreEqual(2, exp.Level);
         Assert.AreEqual(20, exp.ExperiencePoints);
         
     }
 }