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 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);
            }
        }
        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);
            }
            

        }