Ejemplo n.º 1
0
        public void TestSimplyAnalyze()
        {
            var dbUsers = new DatabaseUsers();
            var plugin  = new SVNPlugin();
            var plugin2 = new LanguageExtension.LanguagePlugin();

            new LanguageExtension.LanguagePlugin().LoadDBMaps();
            plugin.LoadDBMaps();
            plugin.Analyze();
            var manager    = new DatabaseManager();
            var db         = manager.GetDatabase();
            var collection = db.GetCollection <IUser>(typeof(IUser).Name);

            foreach (var user in collection.FindAll())
            {
                Assert.AreEqual(Environment.UserName, user.Name);
                Assert.AreEqual(20, ((SVNModel)user.ExtensionPoint["SVNExtension"]).Add);
                Assert.AreEqual(0, ((SVNModel)user.ExtensionPoint["SVNExtension"]).Modified);
                Assert.AreEqual(0, ((SVNModel)user.ExtensionPoint["SVNExtension"]).Deleted);
            }

            var repos = db.GetCollection <SVNRepository>(typeof(SVNRepository).Name);

            foreach (var repo in repos.FindAll())
            {
                Assert.AreEqual(2, repo.CurrentVersion);
            }
        }
Ejemplo n.º 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);
                }
            }
        }
Ejemplo n.º 3
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);
                }
            }

            
        }
        public void TestSimplyAnalyze()
        {            
            var dbUsers = new DatabaseUsers();            
            var plugin = new SVNPlugin();
            var plugin2 = new LanguageExtension.LanguagePlugin();
            new LanguageExtension.LanguagePlugin().LoadDBMaps();            
            plugin.LoadDBMaps();
            plugin.Analyze();
            var manager = new DatabaseManager();
            var db = manager.GetDatabase();
            var collection = db.GetCollection<IUser>(typeof(IUser).Name);
            foreach (var user in collection.FindAll())
            {
                Assert.AreEqual(Environment.UserName, user.Name);
                Assert.AreEqual(20, ((SVNModel)user.ExtensionPoint["SVNExtension"]).Add);
                Assert.AreEqual(0, ((SVNModel)user.ExtensionPoint["SVNExtension"]).Modified);
                Assert.AreEqual(0, ((SVNModel)user.ExtensionPoint["SVNExtension"]).Deleted);
            }

            var repos = db.GetCollection<SVNRepository>(typeof(SVNRepository).Name);
            foreach (var repo in repos.FindAll())
            {
                Assert.AreEqual(2, repo.CurrentVersion);
            }
        }
Ejemplo n.º 5
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);
            }
        }
Ejemplo n.º 6
0
        public void languagePluginlvlUpVerifyDatabaseInsertTest()
        {
            var plugin = new SVNPlugin();

            plugin.Analyze();

            var langPlugin = new LanguagePlugin();

            langPlugin.Compute();

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

            foreach (var user in collection.FindAll())
            {
                var exp = user.ExperiencePoints[typeof(LanguageExperience).Name];
                Assert.AreEqual(Environment.UserName, exp.Name);
                Assert.AreEqual(2, exp.Level);
                Assert.AreEqual(20, exp.ExperiencePoints);
            }
        }
        public void languagePluginlvlUpVerifyDatabaseInsertTest()
        {
            var plugin = new SVNPlugin();
            plugin.Analyze();            

            var langPlugin = new LanguagePlugin();
            langPlugin.Compute();

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

            foreach (var user in collection.FindAll())
            {
                var exp = user.ExperiencePoints[typeof(LanguageExperience).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);
         
     }
 }