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 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 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); } }
public void ModifedBadgeEarnedTest() { var model = new SVNModel(); model.AddModified(2); var badge = new SVNModified(); var p = new SVNPlugin(); p.LoadDBMaps(); p.LoadBadges(); var user = new DefaultUser("teste"); user.ExtensionPoint.Add("SVNExtension", model); badge.Compute(user); Assert.AreEqual(true, badge.Gained); }
public void ModifedBadgeEarnedTest() { var model = new SVNModel(); model.AddModified(2); var badge = new SVNModified(); var p = new SVNPlugin(); p.LoadDBMaps(); p.LoadBadges(); var user = new DefaultUser("teste"); user.ExtensionPoint.Add("SVNExtension", model); badge.Compute(user); Assert.AreEqual(true, badge.Gained); }