Пример #1
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 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 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);            
 }
Пример #4
0
        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);
        }