Exemplo n.º 1
0
        public void premiumWriterClassificationTest()
        {
            DRaumStatistics drs = new DRaumStatistics();

            drs.updateWritersLevel(250, 30);
            Assert.AreEqual(140, drs.getPremiumLevelCap());
        }
Exemplo n.º 2
0
        public void authorStatisticTest()
        {
            AuthorManager atm = new AuthorManager();

            atm.getMedianAndTopLevel(out var median, out var top);
            Assert.AreEqual(0, median);
            Assert.AreEqual(0, top);

            atm.isCoolDownOver(10, "testuser1", Author.InteractionCooldownTimer.Default);
            atm.getMedianAndTopLevel(out median, out top);
            Assert.AreEqual(1, median);
            Assert.AreEqual(1, top);

            atm.isCoolDownOver(20, "testuser2", Author.InteractionCooldownTimer.Default);
            atm.isCoolDownOver(30, "testuser3", Author.InteractionCooldownTimer.Default);
            atm.isCoolDownOver(40, "testuser4", Author.InteractionCooldownTimer.Default);
            atm.isCoolDownOver(50, "testuser5", Author.InteractionCooldownTimer.Default);
            atm.getMedianAndTopLevel(out median, out top);
            Assert.AreEqual(1, median);
            Assert.AreEqual(1, top);

            atm.publishedSuccessfully(10);
            atm.publishedSuccessfully(10);
            atm.publishedSuccessfully(20);
            atm.publishedSuccessfully(20);
            atm.publishedSuccessfully(20);
            atm.publishedSuccessfully(30);
            atm.publishedSuccessfully(40);
            atm.publishedSuccessfully(40);
            atm.publishedSuccessfully(40);
            atm.publishedSuccessfully(50);
            atm.publishedSuccessfully(50);
            atm.publishedSuccessfully(50);
            atm.publishedSuccessfully(50);
            atm.publishedSuccessfully(50);
            atm.getMedianAndTopLevel(out median, out top);
            Assert.AreEqual(2, median);
            Assert.AreEqual(3, top);

            DRaumStatistics drs = new DRaumStatistics();

            drs.updateWritersLevel(top, median);
            Assert.AreEqual(2, drs.getPremiumLevelCap());
        }